From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 19:05:40 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 21:05:40 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> References: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> Message-ID: Julie, Thanks for the quick reply, I don't have any debug output as I am not able to read anything, all it prints is -1 in the run method. Is the configuration ok, do I have all the files needed? what is role of DSR bit? Thanks, Jithu On Thu, Oct 28, 2010 at 8:05 PM, wrote: > Jithu, > > Do you have a sample run with the debug output? Because I don't see > anything wrong with your code right off the top of my head. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 6:22 pm > To: rxtx at qbang.org > > Hi, > > I have a application which needs to read list of barcode's scanned through > a COM port. The java version we are using is 1.6, OS is Windows XP and here > is RXTX information > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in > the jre/lib/ext folder. But when we scan the barcodes we are not receiving > any data through the COM port, however we see the data through a sniffer > software and also through putty. > > Here is my source code which opens connection to the COM port and tries to > read from it > > public void open(String device) throws AresException { > logger.info("Inside Muliscan open port method"); > portName = device; > try { > > /* Get the port identifier for port */ > logger.info("Trying to get the port id for port "+portName); > CommPortIdentifier portId > = CommPortIdentifier.getPortIdentifier(portName); > logger.info("Successfully got the port id"); > /* Actually open the port */ > logger.info("Trying to open the port"); > port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); > logger.info("Successfully opened the port "+port); > if (debug) { > dumpBits(); > } > /* Set the serial ports parameters for the Duplo */ > > port.setSerialPortParams(9600, > SerialPort.DATABITS_8,SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > output = port.getOutputStream(); > input = port.getInputStream(); > > /* > * Create a new thread to read the input stream. The > * thread is not started until the open method is > * called. The setDaemon method allows the Java > * Virtual Machine to exit even though this thread is > * still running. > */ > > reader = new Thread(this); > reader.setDaemon(true); > logger.info("Created new thread to read input stream"); > /* > * Start the reader thread to read bytes from the > * duplo > */ > reader.start(); > } catch (Exception e) { > logger.info("Exception occurred when trying to open the port"); > throw new AresException(e.getMessage()); > }catch(Error err) { > throw new AresException(err.getMessage()); > } > > } > > public void run() { > /* > * Reset the threadStop variable to false so the run loop > * will execute. > */ > threadStop = false; > try { > StringBuffer sb = new StringBuffer(); > boolean noRead = false; > while(!threadStop) { > int c = input.read(); > running = true; > if (c == STX) { > sb = new StringBuffer(); > } > > else if (c == NULL) { > running = false; > notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); > } else if (c == CR) { > /* > * Convert message to a string for > * easy processing > */ > String data = sb.toString(); > notify(new AresBarcodeEvent(data)); > } > > else { > /* add the byte to input buffer */ > sb.append((char)c); > } > } > } catch(Exception e) { > > System.err.println(e); > > } > } > > Can any one please tell what could be wrong here? > > Any sugesstions? > > Thanks in advance. > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 20:49:11 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 19:49:11 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From jithu.mada at gmail.com Thu Oct 28 21:06:02 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 23:06:02 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX In-Reply-To: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> References: <20101028194911.8ef0e5b4a80cef441275a6330ffad77d.b36a081d13.wbe@email13.secureserver.net> Message-ID: Julie, It opens the connection to the COM port sucessfully, but when the barcodes are scanned using a high speed scanner it doesn't get that data. When I connect a putty to the COM port and scan the barcodes I get all that data. Not sure what is the problem with the code. Thanks, Jithu On Thu, Oct 28, 2010 at 10:49 PM, wrote: > Jithu, > > If you aren't even getting the software to run, you have an entirely > different problem that I suspect we can't solve. I thought you were getting > it run, but not produce data. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Unable to read from COM port using RXTX > From: jithu mada > Date: Thu, October 28, 2010 8:05 pm > To: rxtx at qbang.org > > Julie, > > Thanks for the quick reply, I don't have any debug output as I am not able > to read anything, all it prints is -1 in the run method. > > Is the configuration ok, do I have all the files needed? > > what is role of DSR bit? > > Thanks, > > Jithu > > On Thu, Oct 28, 2010 at 8:05 PM, wrote: > >> Jithu, >> >> Do you have a sample run with the debug output? Because I don't see >> anything wrong with your code right off the top of my head. >> -- >> Julie Haugh >> Senior Design Engineer >> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on >> Skype >> >> >> -------- Original Message -------- >> Subject: [Rxtx] Unable to read from COM port using RXTX >> From: jithu mada >> Date: Thu, October 28, 2010 6:22 pm >> To: rxtx at qbang.org >> >> Hi, >> >> I have a application which needs to read list of barcode's scanned through >> a COM port. The java version we are using is 1.6, OS is Windows XP and here >> is RXTX information >> >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in >> the jre/lib/ext folder. But when we scan the barcodes we are not receiving >> any data through the COM port, however we see the data through a sniffer >> software and also through putty. >> >> Here is my source code which opens connection to the COM port and tries to >> read from it >> >> public void open(String device) throws AresException { >> logger.info("Inside Muliscan open port method"); >> portName = device; >> try { >> >> /* Get the port identifier for port */ >> logger.info("Trying to get the port id for port "+portName); >> CommPortIdentifier portId >> = CommPortIdentifier.getPortIdentifier(portName); >> logger.info("Successfully got the port id"); >> /* Actually open the port */ >> logger.info("Trying to open the port"); >> port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); >> logger.info("Successfully opened the port "+port); >> if (debug) { >> dumpBits(); >> } >> /* Set the serial ports parameters for the Duplo */ >> >> port.setSerialPortParams(9600, >> SerialPort.DATABITS_8,SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> >> output = port.getOutputStream(); >> input = port.getInputStream(); >> >> /* >> * Create a new thread to read the input stream. The >> * thread is not started until the open method is >> * called. The setDaemon method allows the Java >> * Virtual Machine to exit even though this thread is >> * still running. >> */ >> >> reader = new Thread(this); >> reader.setDaemon(true); >> logger.info("Created new thread to read input stream"); >> /* >> * Start the reader thread to read bytes from the >> * duplo >> */ >> reader.start(); >> } catch (Exception e) { >> logger.info("Exception occurred when trying to open the port"); >> throw new AresException(e.getMessage()); >> }catch(Error err) { >> throw new AresException(err.getMessage()); >> } >> >> } >> >> public void run() { >> /* >> * Reset the threadStop variable to false so the run loop >> * will execute. >> */ >> threadStop = false; >> try { >> StringBuffer sb = new StringBuffer(); >> boolean noRead = false; >> while(!threadStop) { >> int c = input.read(); >> running = true; >> if (c == STX) { >> sb = new StringBuffer(); >> } >> >> else if (c == NULL) { >> running = false; >> notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); >> } else if (c == CR) { >> /* >> * Convert message to a string for >> * easy processing >> */ >> String data = sb.toString(); >> notify(new AresBarcodeEvent(data)); >> } >> >> else { >> /* add the byte to input buffer */ >> sb.append((char)c); >> } >> } >> } catch(Exception e) { >> >> System.err.println(e); >> >> } >> } >> >> Can any one please tell what could be wrong here? >> >> Any sugesstions? >> >> Thanks in advance. >> ------------------------------ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > ------------------------------ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Oct 28 22:22:23 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Fri, 29 Oct 2010 00:22:23 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: Message-ID: <4CCA4BFF.5050707@howardz.com> On a Microsoft Windows operating system there is no need for port testing/searching. For a variety of reasons it is rather stupid to do this port testing on a windows system. In the windows' registry is a list of all available com ports. I modified my own copy of rxtx to look into the windows registry - if running on a ms windows system. This is the only modification I have made to my private version of rxtx, and when I posted it here in the recent past - the code got super criticized and attacked. I actually posted it to show how I used JNA calls to access the registry I do not plan to add it to the rxtx CVS. Howard > Message: 1 > Date: Tue, 26 Oct 2010 09:29:05 -0400 > From: David R Robison > To: rxtx at qbang.org > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long > time > Message-ID:<4CC6D7A1.70103 at openroadsconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to > return. Is there anyway I can improve on this time? Thanks, David > From msemtd at googlemail.com Fri Oct 29 01:54:22 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 29 Oct 2010 08:54:22 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> References: <4CCA4BFF.5050707@howardz.com> Message-ID: On 29 October 2010 05:22, HowardZ at howardz.com wrote: > I modified my own copy of rxtx to look into the windows registry - if > running on a ms windows system. > > This is the only modification I have made to my private version of rxtx, and > when > I posted it here in the recent past - the code got super criticized and > attacked. > > I actually posted it to show how I used JNA calls to access the registry > > I do not plan to add it to the rxtx CVS. You should certainly put it on the wiki though -- its a damn good idea. If its optional (i.e. not in CVS) then nobody has grounds for complaint unless they want to come up with something better! Regards, Michael Erskine From andrea.antonello at gmail.com Fri Oct 29 02:08:17 2010 From: andrea.antonello at gmail.com (andrea antonello) Date: Fri, 29 Oct 2010 10:08:17 +0200 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: References: <4CCA4BFF.5050707@howardz.com> Message-ID: +1 with Michael, I would love to give it an eye and try it out. Andrea On Fri, Oct 29, 2010 at 9:54 AM, Michael Erskine wrote: > On 29 October 2010 05:22, HowardZ at howardz.com wrote: >> I modified my own copy of rxtx to look into the windows registry - if >> running on a ms windows system. >> >> This is the only modification I have made to my private version of rxtx, and >> when >> I posted it here in the recent past - the code got super criticized and >> attacked. >> >> I actually posted it to show how I used JNA calls to access the registry >> >> I do not plan to add it to the rxtx CVS. > > You should certainly put it on the wiki though -- its a damn good > idea. If its optional (i.e. not in CVS) then nobody has grounds for > complaint unless they want to come up with something better! > > Regards, > Michael Erskine > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at yahoo.com Fri Oct 29 05:42:55 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Fri, 29 Oct 2010 04:42:55 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long, time In-Reply-To: <4CCA4BFF.5050707@howardz.com> Message-ID: <766307.89406.qm@web63103.mail.re1.yahoo.com> --- On Thu, 10/28/10, HowardZ at howardz.com wrote: > On a Microsoft Windows operating > system there is no need for port testing/searching. > For a variety of reasons it is rather stupid to do this > port testing on a windows system. > In the windows' registry is a list of all available com > ports. > > I modified my own copy of rxtx to look into the windows > registry - if running on a ms windows system. The rewrite uses that approach and it works great! I see no reason not to include it in the 2.x version. -Adrian From mariusz.dec at gmail.com Tue Oct 5 00:42:44 2010 From: mariusz.dec at gmail.com (M.Dec-GMail) Date: Tue, 5 Oct 2010 08:42:44 +0200 Subject: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] References: <40FAD90D582845149A7EF8024FF58480@mdam2><3217FDCB-3F52-46C3-8C1D-61FA6B6A1CB1@rwth-aachen.de> <5620FB8D-6103-44DC-B4D4-7066EE182A98@rwth-aachen.de> Message-ID: <0A8129C5B7244FF89B0B9CD25EB912DE@mdam2> Hi Philipp, please let know (me and community) if everything works on your Mac or not. About GlobalMutex below - this is enough, I think. I did two mutexes and left it. In fact it changes nothing except that needs one operation only - better/easier way I think :). RE: > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. I have wriiten earlier - I am feeleing not to strong to change IO code for so many platforms, so I have decided to work in "safer" environment like Java. Solution works (at least in my application and many more) - this is enough for me :) Regards Mariusz ----- Original Message ----- From: "Philipp Leusmann" To: Sent: Thursday, September 30, 2010 2:26 PM Subject: Re: [Rxtx] RXTX and Macintosh, Information Please [SEC=UNCLASSIFIED] > Hi Mariusz, > > please see inline comments. > > Am 29.09.2010 um 12:19 schrieb Mariusz Dec: > >> Hi Philipp, >> Yes, you are "almost" right - synchronised closing this is ONLY the >> part of the trick , the second thing in Mac & Linux is Receive >> timeout. >> This is described in example as the "critical confiiguration stuff". > > > Cool, this really seems to help. > Though, which unit is the timeout in? milliseconds? seconds? > > >> >> I have tried to do this trick "inside" RXTX, but without successes, so >> I have decided to prepare a kind of the workaround without patches >> (CVS). >> I think that anyway this is enough good way - in my opinion a bit of >> work should stay for the application's programmer :) - utility >> packages aren't applications :). > > But I still consider locking up when running multi-threaded a library issue and it would be great, if it could be fixed without jumping through hoops in the application code. > > >> >> As I have mentioned in example, this code works with "pure" >> RXTX2.2pre2 from November 2009. >> If you would like to check my code in such environment, please let me >> know, I will prepare this RXTX sources on my FTP for you. >> > > I tried using the CVS code from some weeks ago. > >> Another friends who have had succeses with this code, always have >> started from my pure example. Have you checked it? > > Yes, I checked your example but simply forgot to add the timeout. > I added the stuff to my own pre-existing code. > > To sum my results up, it seems it must be performed in each thread like this (in pseudo-code): > > CommPort.enableReceiveTimeout(100); > > synchronized (GLOBAL_MUTEX) { > CommPortIdentifier.open(...); > } > > //perform IO > > //wait until all threads finished IO operations > > synchronized (GLOBAL_MUTEX) { > CommPort.close(); > } > > > Did I forget anything important? > > Regards, > Philipp > > >> >> Regards >> Mariusz >> >> >> >> >> >> 2010/9/29, Philipp Leusmann : >>> Hi, >>> >>> sorry, I do not really get the status of this discussion. >>> I saw Mariusz did publish the sources for the client, but cannot find any of >>> the mentioned patches to RXTX. Have they been merged into the CVS? >>> >>> I am experiencing locking when trying to close the serial connection, and I >>> guess this is what it's all about. Isn't it? >>> >>> By looking at the client code posted by Mariusz it seems that synchronizing >>> access when closing one thread to avoid any IO-Operations by other threads >>> shall do the trick. Did I get this right? >>> The last time I checked, this did not help at all (using CVS code from some >>> weeks ago). >>> >>> It would be really cool, if this problem can be fixed. >>> >>> Regards, >>> Philipp >>> >>> >>> >>> Am 14.09.2010 um 09:36 schrieb M.Dec-GM: >>> >>>> Thank you John :) >>>> I have just prepared Java workaround example app with documentation >>>> inside, and in few minutes it will available here as well. >>>> I think that your solution is good, but in my example I am showing >>>> aditionally a very fast method of the transferring data from serial to >>>> application. >>>> It was suggestion of Michael Erskine and I did it. >>>> So I will publish it as well :) >>>> >>>> Regards >>>> Mariusz >>>> >>>> >>>> ----- Original Message ----- >>>> From: "John Coffey" >>>> To: >>>> Sent: Tuesday, September 14, 2010 8:24 AM >>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>> [SEC=UNCLASSIFIED] >>>> >>>> >>>> Mariusz, >>>> >>>> here is a patch that I've been testing this evening so far without >>>> problems (I tested Windows XP 32 bit earlier and here I just finished >>>> testing a recompiled set of DLLs on x64 (compiled as x64), My code is >>>> against the head of the current build and includes the disconnect >>>> patch and a single patch that I needed for an 8200 byte input buffer >>>> that I needed for my app. My patch is basically a combination of the >>>> patch below brought up to date with the head of the 2.2pre2 tree in >>>> CVS and a separate as per the link below you will need to include >>>> Ilkkya's separate files are included via the link below. >>>> My patch was generated by cvs diff -up . > latestgreatest.patch so the >>>> patch can be applied >>>> >>>> src/gnu/io/PortAlreadyClosedException.java >>>> src/gnu/io/SerialReconnectDemo.java >>>> >>>> It is in 'cvs diff -up' format. It can be applied with 'patch -p0 < >>>> latestgreatest.patch' in rxtx-devel directory >>>> >>>> I added one thing that I needed for myself (for SetupComm to have an >>>> 8k buffer for an avionics protocol, without it my app hung and >>>> unfortunately the APIs to set the input and output buffer size for the >>>> communications port are no-ops (see my commented out app code below)! >>>> If you could see your way to putting that function in I would be >>>> really grateful >>>> http://mailman.qbang.org/pipermail/rxtx/2009-September/5724682.html >>>> >>>> /** internal thread control logic */ >>>> private void doCommControl(final Command aCommand) throws IOException { >>>> try { >>>> switch (aCommand) { >>>> case StartComms: >>>> mSerialPort = (SerialPort) mPortId.open("SerialMonitor", 2000); >>>> // @TODO: Try to add support for buffer size >>>> // This currently does not work as the port size >>>> // parameter is ignored >>>> // mSerialPort.setInputBufferSize(8200); >>>> // int inputBufferSize = mSerialPort.getInputBufferSize(); >>>> // mSerialPort.setOutputBufferSize(8200); >>>> // int outputBufferSize = mSerialPort.getOutputBufferSize(); >>>> // pre fetch from the receive buffer >>>> //mSerialPort.enableReceiveThreshold(4096); >>>> if (mFlowControl == FlowControl.FlowCtsRts) { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_RTSCTS_IN | >>>> SerialPort.FLOWCONTROL_RTSCTS_OUT); >>>> } else { >>>> mSerialPort.setFlowControlMode( >>>> SerialPort.FLOWCONTROL_NONE); >>>> } >>>> mInputStream = mSerialPort.getInputStream(); >>>> mOutputStream = mSerialPort.getOutputStream(); >>>> mSerialPort.addEventListener(this); >>>> >>>> >>>> On Tue, Sep 14, 2010 at 1:04 AM, M.Dec-GM wrote: >>>>> Hi John, Hi Brian, Hi All >>>>> >>>>> I have send a parts of application with this code - (it isn't RXTX patch) >>>>> to >>>>> coulple of peples. >>>>> But now there is more questions... >>>>> We have a new day now - 7:00 am. I will busy until 10 am. >>>>> After that I will prepare clear example and I will publish it here. >>>>> Regards >>>>> Mariusz >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: Brian Schlining >>>>> To: rxtx at qbang.org >>>>> Sent: Tuesday, September 14, 2010 2:08 AM >>>>> Subject: Re: [Rxtx] RXTX and Macintosh, Information Please >>>>> [SEC=UNCLASSIFIED] >>>>> >>>>> >>>>>> I recall the elegant fix you put together to >>>>>> handle Close/reopen/disconnect USB patch? As I recall the only downside >>>>>> from general adoption by the rxtx community was that the signature of >>>>>> some >>>>>> methods had an extra exception which was not quite compatible with >>>>>> javax.comm or something to that effect. I can certainly live with that >>>>>> :) >>>>>> given the benefits of your fixes. >>>>> >>>>> I haven't looked at the code in question, but if the only downside is a >>>>> change to the method signature I would recommend the following, if you >>>>> want >>>>> wider adoption: >>>>> 1) If it's a new checked exception that's being thrown (i.e a subclass of >>>>> Exception), change the exception to an unchecked (i.e. a subclass of >>>>> RuntimeException). >>>>> 2) Document in the javadoc that the method can throw your special >>>>> Exception. >>>>> 3) Return the method signature to match what RXTX had. The method can >>>>> still >>>>> throw your exception but it doesn't force users to catch it like a >>>>> checked >>>>> Exception does. >>>>> Just my 2 cents >>>>> -- >>>>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ >>>>> Brian Schlining >>>>> bschlining at gmail.com >>>>> >>>>> ________________________________ >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From David.Escalona at digi.com Wed Oct 6 03:50:28 2010 From: David.Escalona at digi.com (Escalona, David) Date: Wed, 6 Oct 2010 11:50:28 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USB really) Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid6048.log Type: application/octet-stream Size: 13361 bytes Desc: hs_err_pid6048.log URL: From mariusz.dec at gmail.com Wed Oct 6 04:41:05 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 6 Oct 2010 12:41:05 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> Message-ID: <9744328429E0437DA432AE45F1C8DE4E@mdam2> Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Mon Oct 11 03:07:23 2010 From: David.Escalona at digi.com (Escalona, David) Date: Mon, 11 Oct 2010 11:07:23 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <9744328429E0437DA432AE45F1C8DE4E@mdam2> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Thanks for the answer, I tried all your suggestions but it is still crashing. I don't know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don't know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucio at sulweb.org Mon Oct 11 03:35:13 2010 From: lucio at sulweb.org (Lucio Crusca) Date: Mon, 11 Oct 2010 11:35:13 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial =?iso-8859-15?q?port=09?=(USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <201010111135.13529.lucio@sulweb.org> In data luned? 11 ottobre 2010 11:07:23, Escalona, David ha scritto: > I tried all your suggestions but it is still crashing. I don't know what is > wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). Same situation here (I just realized this problem is actually the main reason I'd like to see a JNA version of rxtx - JNA would force to raise exceptions and it would avoid JVM crashes, unless there is a bug in JNA itself). For the time being, I wrapped rxtx code into a daemon that runs in a separate JVM. Then a little dirty script relaunches the daemon each time it crashed... quick, very dirty, but hey, it works! From jredman at ergotech.com Mon Oct 11 06:59:55 2010 From: jredman at ergotech.com (Jim Redman) Date: Mon, 11 Oct 2010 06:59:55 -0600 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE33B@dor-sms-exch01.digi.com> <9744328429E0437DA432AE45F1C8DE4E@mdam2> <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <4CB30A4B.1090105@ergotech.com> David, On 10/11/2010 03:07 AM, Escalona, David wrote: > Thanks for the answer, > > I tried all your suggestions but it is still crashing. I don?t know what > is wrong as I do not understand the crash log. Is there any way to know > exactly what is causing the crash? Is it possible to convert that crash > into a java exception? (Really, this could be a show stopper for us). The crash seems to be an "access violation" (0xc0000005). Which, unfortunately covers a number of possible errors. If you put the native code into a development system and "run" it from within that environment then, if the native code has debug symbols, you can debug the code and catch the exception. I haven't done this for a while, and never with RXTX. In essence, you can take something like Visual Studio and build the RXTX library in that (is there a project in the source?) and then you set the command to run as the command line that runs your application. You can set breakpoints, traps, etc. You can also trace with gcc, it's a little less convenient because it not so well integrated. You can probably also get the C/C++ version of Eclipse and use that to trace through the code. (Can you trace Java and C/C++ in the same environment this way??). Jim > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On > Behalf Of *M.Dec-GM > *Sent:* Wednesday, October 06, 2010 12:41 > *To:* rxtx at qbang.org > *Subject:* Re: [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hi, > > 1. Try with newer Java (probably will not help) > > 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may > helps > > 3. Check if USB isn't going automatically to power saving mode - most > often problem with USB VCP and Laptops -> switch it off. Check it even > if desktop > > 4. Check drivers's latency (Port settings -> Advanced), try with shorter > (not all HW/SW have this possibility). > > 5. Let us know about results > > Regards > > Mariusz > > ----- Original Message ----- > > *From:* Escalona, David > > *To:* 'rxtx at qbang.org' > > *Sent:* Wednesday, October 06, 2010 11:50 AM > > *Subject:* [Rxtx] Random JVM crash while writing data to serial port > (USBreally) > > Hello all, > > Since several months I am experiencing a JVM random crash while > writing data to Serial Port (USB in this case). I have tried with > the 2.2pre with same results. I am attaching a JVM crash log so you > can take a look. All crashes are the same, so are logs. Don?t know > what am I doing wrong or the reason of the crash. Hope you can help me. > > Thanks. > > -- > > *David Escalona* > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at yahoo.com Mon Oct 11 08:52:14 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Mon, 11 Oct 2010 07:52:14 -0700 (PDT) Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> Message-ID: <687834.45464.qm@web63103.mail.re1.yahoo.com> The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). ? Thanks in advance. -- David Escalona ? From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to?power saving mode - most?often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ? ? ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) ? Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. ? Thanks. -- David Escalona ? _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Tue Oct 12 03:00:16 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Tue, 12 Oct 2010 11:00:16 +0200 Subject: [Rxtx] [RxTx]Missing rxtxParallel.dll file and JVM crash Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F0360D05A@lune.ses-esl.com> Hi, With the new Rxtx2.2pre2 we don't get crash for a while with Serial port and for parallel we use the old rxtxParallel.dll because the rxtx-2.2pre2-bins.zip didn't contains it. But some time we get random crash as attached with a parallel port on Windows Xp. I don't know if the new rxtxParallel.dll fixes this kind of a problem, but it will very very cool that delivry manager create a new zip file with the new rxtxParallel.dll, very specially if it solves some problems. Best regards, Fran?ois-Xavier Gendrin Responsable planning d?veloppement _________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1320.log Type: application/octet-stream Size: 14668 bytes Desc: hs_err_pid1320.log URL: From will.tatam at red61.com Tue Oct 12 04:58:49 2010 From: will.tatam at red61.com (Will Tatam) Date: Tue, 12 Oct 2010 11:58:49 +0100 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <124496.81037.qm@web63108.mail.re1.yahoo.com> References: <124496.81037.qm@web63108.mail.re1.yahoo.com> Message-ID: <4CB43F69.1030105@red61.com> Adrian Crum wrote: > --- On Fri, 9/17/10, Lucio Crusca wrote: > >> Hello *, >> >> I'd need a version of rxtx without the "crash on >> disconnect" problem. I've >> read a few posts claiming a java-only solution, while some >> other offer a >> patch, e.g. the one attached to bug#144. >> >> What's the best way to go? Has 2.2pre2 the same problem? >> @Adrian Crum: do you think the rewrite is stable enough for >> simple reading >> from a single port on Linux and Windows in a production >> app? >> > > The rewrite is preliminary code, so it is not ready for production. It only runs on Windows - volunteers are needed to write Linux and Mac native code. > > -Adrian > Are there any notes written anywhere describing what exactly needs to be written to provide linux support ? -- Will Tatam From jfh at greenhousepc.com Tue Oct 12 06:25:52 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 05:25:52 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:36:27 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:36:27 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012052552.8ef0e5b4a80cef441275a6330ffad77d.0bd970ce7f.wbe@email13.secureserver.net> Message-ID: <799761.7681.qm@web63102.mail.re1.yahoo.com> -- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Cc: adrian.crum at yahoo.com Date: Tuesday, October 12, 2010, 5:25 AM Will Tatam writes: | Are there any notes written anywhere describing what exactly needs to be | written to provide linux support ? I'm not convinced a re-write from scratch is even the answer.? Without understanding why the existing code breaks (do people understand exactly why?), a re-write may well have the same sort of problem.? And if people understand why the existing code breaks, why hasn't it just been fixed? -- Julie Haugh Senior Design Engineer greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but there were too many issues to fix - the patches ended up being essentially a rewrite. The rewrite does not exhibit the crashes on Windows. It remains to be seen if the rewrite fixes the crashes on other platforms - since the native code for other platforms has not been written. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 07:39:11 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 06:39:11 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <4CB43F69.1030105@red61.com> Message-ID: <217349.7468.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, Will Tatam wrote: > Adrian Crum wrote: > > --- On Fri, 9/17/10, Lucio Crusca > wrote: > >??? > >> Hello *, > >> > >> I'd need a version of rxtx without the "crash on > >> disconnect" problem. I've read a few posts > claiming a java-only solution, while some > >> other offer a patch, e.g. the one attached to > bug#144. > >> > >> What's the best way to go? Has 2.2pre2 the same > problem? > >> @Adrian Crum: do you think the rewrite is stable > enough for > >> simple reading from a single port on Linux and > Windows in a production > >> app? > >>? ??? > > > > The rewrite is preliminary code, so it is not ready > for production. It only runs on Windows - volunteers are > needed to write Linux and Mac native code. > > > > -Adrian > >??? > Are there any notes written anywhere describing what > exactly needs to be written to provide linux support ? Do a CVS checkout of the current trunk: http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code In it there is a folder named Rewrite2010 - it contains all of the new code. In the Rewrite2010 folder you will find a PDF file describing the rewrite in detail and how to implement it on all platforms. -Adrian From jfh at greenhousepc.com Tue Oct 12 08:19:23 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 07:19:23 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Oct 12 09:11:08 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Tue, 12 Oct 2010 17:11:08 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <87665F7E55B14DF7BF0983C7ED78B4CE@mdam2> Hi all, ----- Original Message ----- From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem Julie has written: > Yes, and I've been following the mailing list. What I've not seen is a root causal analysis of the problem. But it isn't easy... this is somewhere in OS, between hardware serial and software for this hardware and Virtual Com Port which is partially served in "USB part" of the OS. If you disconnect USB, you don't know what USB software is doing now - pooling, receiving, sending, anlaysing USB packet ?????? And how programmer of the VCP driver did exception services. Everybody knows how some USB drivers are written... So, this is why I think that this is neverending story to find good multiplatform solution for this reason (USB disconnection) with JNI, with Vendor's VCP drivers, OS's I/o services etc. I have prepared and published here sample Java code which prevents described crashes for me - in W/M/L. There are notices about used systems and VCP drivers and hardware as well. Some peoples has answered me that it works, maybe in many cases it doesn't work, but there is no back-info here as well - good or bad - nothing... Mariusz _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at yahoo.com Tue Oct 12 09:17:34 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 08:17:34 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012071923.8ef0e5b4a80cef441275a6330ffad77d.cb8436d78c.wbe@email13.secureserver.net> Message-ID: <72810.73472.qm@web63105.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: |The reasons for crashes have been discussed on this mailing list. I started to patch the existing code, but| there were too many issues to fix - the patches ended up being essentially a rewrite. Yes, and I've been following the mailing list.? What I've not seen is a root causal analysis of the problem. I don't see the disconnect-and-crash bugs because I don't have clients who remove USB hardware, and I spec a very small number of USB converters that work very well.? The rest of my clients use standard PC UARTs on the motherboard, and those are pretty hard to remove.? So, the only problems I've had in going on 4 years using RXTX are the "YACK()" macro overflow from 2.1.7 and the broken timeout / threshold code (which completely broke my Modbus code ...) in 2.2pre2. What I'm concerned about is that you're going to replace JNI / JRE crashes with just plain bugs.? I'm also concerned this is another instance of "There is always time to do it over, but never enough time to do it right."? I've been a professional programmer for 31 years -- I know the temptation to re-write code is much stronger than the willingness to fix what is already written. Perfectly willing to put fingers to keyboard and code, if need be.? But without a root causal analysis, my tendency is to stay put. It's wonderful that your installations are working without any problems, but that doesn't make it true for everyone else. In the few months I've been involved in this community I have seen numerous emails from others who are having problems - and I was one of them too. While doing research for the rewrite I came across numerous forums with many more messages from people having problems with RXTX. Clearly, there are problems with the code. The rewrite was not motivated solely by crashes from disconnected serial devices - there are multi-threading issues, native code errors are not being propagated back to Java code, JNI exceptions are not being caught, portions of the code do not follow the javax.comm API, etc, etc. The existing RXTX code is legacy code that has been around since the 90s. Like a lot of legacy code, it has become a huge mess - which makes the code extremely fragile and difficult to maintain. I don't blame Trent for being hesitant to commit changes to the existing code base - because a simple change could easily break the code. As I said previously, I tried to fix the issues I encountered, but there are too many of them. I'm not a big fan of rewrites and I avoid them whenever possible - so I'm not rushing into this. It might help the discussion if you would take a look at the rewrite. One of the goals is to achieve 100% unit test coverage - something the existing code base doesn't do. If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are encountered, they should be easier to find and fix. Right now I am busy preparing another open source project for a release. As soon as I'm done with that I will begin work on the rewrite's unit tests. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 09:30:18 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 08:30:18 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 12 10:22:55 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 12 Oct 2010 09:22:55 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <4CB48B5F.2060605@CasaDelGato.Com> On 10/12/2010 8:30 AM, jfh at greenhousepc.com wrote: > | > | > So how is switching from JNI code (which I think is horrible, but > which is a known quantity) > to JNA code going to prevent whatever problems are happening. Because > not knowing that > means whatever is causing the JNI code (which I think is horrible) to > crash could well not > be fixed, AND we have a new code base with new bugs AND yet another JAR. > For one thing, all the code is Java. So can be debugged by more people. I don't currently have a Linux (or Mac) C dev system. So I can't even debug the JNI errors there. Nor can I build a working library. (and I still haven't found a working Mac library.) Actually, since I don't have the same MS Win dev system, I can't debug the JNI errors on Windows either. If it was all Java code, it would make it a LOT easier to catch all the exceptions, and add logging for debugging purposes, AND I wouldn't need umpteen different dev systems just to build a set of libraries. -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 10:44:55 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 09:44:55 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 12:32:23 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 11:32:23 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012094455.8ef0e5b4a80cef441275a6330ffad77d.86c69c11df.wbe@email13.secureserver.net> Message-ID: <663154.26638.qm@web63108.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: From: jfh at greenhousepc.com Subject: Re: [Rxtx] well known disconnect and crash problem To: rxtx at qbang.org Date: Tuesday, October 12, 2010, 9:44 AM Adrian Crum writes: | It might help the discussion if you would take a look at the rewrite. One of the goals| is to achieve 100% unit test coverage - something the existing code base doesn't do.| If anything, the rewrite will have have demonstrably fewer bugs, and when bugs are| encountered, they should be easier to find and fix. Okay, I've done that and now I'm 100% opposed to the concept of a re-write.? Inparticular, this code in CommPortEnumerator.java Public Object nextElement() {if (!iterator.hasNext()) {throw new NoSuchElementException();}return iterator.next();} isn't thread safe.? I mean, it =is= thread safe, but there's no guarantee the NoSuchElementException() exception is going to come from the if()-block and not the iterator.next() call when someone else called nextElement() on the same object in a different thread.? Might as well simplify to Public Object nextElement() {return iterator.next();}? The "old" code at least had a mutex for serialization. Thanks - I added the synchronized keyword to the method. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Tue Oct 12 13:19:16 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Tue, 12 Oct 2010 12:19:16 -0700 Subject: [Rxtx] well known disconnect and crash problem Message-ID: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at yahoo.com Tue Oct 12 13:56:08 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 12 Oct 2010 12:56:08 -0700 (PDT) Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <553245.69256.qm@web63106.mail.re1.yahoo.com> --- On Tue, 10/12/10, jfh at greenhousepc.com wrote: Adrian Crum writes: | Thanks - I added the synchronized keyword to the method. That unfortunately isn't enough, because "iterator" is what needs to be synchronized, not the class instance.? If I construct two of those objects (somehow ...) and "iterator" is accessed from another class, you've just lost synchronization. I think you need to spend more time looking at the code. First of all, accessing a single enumerator from multiple threads is poor code design. Most Java programmers know they will need to synchronize around it. In other words, it's an application issue, not an RXTX issue. Secondly, each enumerator is backed by by an Iterator, which in turn is backed by a copy of the List being traversed. So multiple threads can iterate over their enumerators without worrying about the list contents being changed mid-traversal by another thread. It's a non-blocking design pattern. This is the problem with re-writes.? All the little gotchas that were solved years earlier are now fair game for fresh new bugs. The same problem exists when fixing existing code - the bug fix might introduce a new bug. The issue isn't if the rewrite will have bugs - both versions will have them. The issue is which version will be easier to fix. My experience with RXTX tells me the rewrite will be easier to fix. I'm not trying to bust your chops, but if you go forward with this large of a re-write, I'm going to fix version 2.2 as much as I need and stay with it. That's fine. The success of the rewrite will depend upon community participation. The more eyes we have looking at the code, the better it will become (this exchange being an example). I know there was a previous rewrite effort that went nowhere. Maybe this effort will meet the same fate. If that's the case, I'm okay with it. In the end I walk away with a version that doesn't crash, or exhibit strange behavior in multi-threaded applications. -Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Tue Oct 12 13:58:02 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Tue, 12 Oct 2010 12:58:02 -0700 Subject: [Rxtx] well known disconnect and crash problem In-Reply-To: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> References: <20101012121916.8ef0e5b4a80cef441275a6330ffad77d.afd9a7be23.wbe@email13.secureserver.net> Message-ID: <4CB4BDCA.7030805@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jfh at greenhousepc.com wrote: | Adrian Crum writes: | | | Thanks - I added the synchronized keyword to the method. | | That unfortunately isn't enough, because "iterator" is what needs to be | synchronized, not the class instance. If I construct two of those objects | (somehow ...) and "iterator" is accessed from another class, you've just lost | synchronization. | | This is the problem with re-writes. All the little gotchas that were solved | years earlier are now fair game for fresh new bugs. | | I had a guy on my team 12 or 13 years ago who decided to re-write a run time | library. He managed to convince my boss that he was going to somehow "get it | right" because the original code was 8 years old and had issues. Within two | years it was obvious he'd made a mistake (or twenty) and that the new library | was worse than the old. So I had to get 2 programmer-years worth of staffing | allocated to undo what he'd done because he'd long since moved on. | | I'm not trying to bust your chops, but if you go forward with this large of a | re-write, I'm going to fix version 2.2 as much as I need and stay with it. I | can't afford to have products going out the door with bugs I don't understand. | I'm probably not the only user of RXTX who feels that way. You really need to | know that what you're doing is the right choice, and that usually means much | smaller changes than "all of it". | -- | Julie Haugh | Senior Design Engineer | greenHouse Computers, LLC // jfh at greenhousepc.com | // greenHousePC on Skype | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Julie, I think this has been sort of touched upon but not really explicitly stated back in August regarding the use of JNA over JNI. If there is sufficient code to build out the needed functionality and enough volunteers to maintain it, then I don't really see why it couldn't succeed. With that said though, he does state that the rewrite is preliminary code and not production ready. I think quite a few of us are in the same boat as you are and basically, we just maintain our own versions from the CVS and try to contribute back as much as possible. Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAky0vcoACgkQg7TIS7A9iscb4QCfWGEr6338aK1hWTccTUi1pbAu nNQAoLqe1xDFbUwqqFBdOzfigwKl7ht9 =jVql -----END PGP SIGNATURE----- From mariusz.dec at gmail.com Wed Oct 13 00:22:49 2010 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Wed, 13 Oct 2010 08:22:49 +0200 Subject: [Rxtx] well known disconnect and crash problem References: <20101012083017.8ef0e5b4a80cef441275a6330ffad77d.0aaa075bf8.wbe@email13.secureserver.net> Message-ID: <237F5B9AB81E42719D1EE88676A08486@mdam2> Hi Julie, You have wriiten: "Let's try this -- I don't see this behavior, for the reasons I listed previously, but what blows up when someone removes a USB device? The infinite loop of error messages that I'd seen before were fixed with the YACK() macro fix. It seems that getting that infinite loop of error messages to end, and adding the appropriate error recovery, would solve many of the problems that are being seen. Without a complete re-write." I did it. Did you see my example? Infinite errors message loop goes to system console, and stops while reconnecting and reopening port. BTW: Somebody here has written about new errors in new libraries and errors after correcting erros... I am going a step ahead: While correcting one error, most often you are generating two new errors :) And this is why we will have a job to the end of the world (and the day after as well). Regards Mariusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From fx.gendrin at ses-esl.com Thu Oct 14 14:11:33 2010 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Thu, 14 Oct 2010 22:11:33 +0200 Subject: [Rxtx] developper expert rxtx Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F031C50BC@lune.ses-esl.com> Hi, I?m project manager of a project which uses RxTx for device serial and parallel and export this in thousand servers in the world. We really need a technical support to get a reliable solution for Windows. If you are an expert in RxTx windows development, thanks to send me a message. Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Escalona at digi.com Fri Oct 15 04:06:55 2010 From: David.Escalona at digi.com (Escalona, David) Date: Fri, 15 Oct 2010 12:06:55 +0200 Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) In-Reply-To: <687834.45464.qm@web63103.mail.re1.yahoo.com> References: <1FD68CB59C3190408725722FDA3E2C730158216CE372@dor-sms-exch01.digi.com> <687834.45464.qm@web63103.mail.re1.yahoo.com> Message-ID: <1FD68CB59C3190408725722FDA3E2C730158216CE3AB@dor-sms-exch01.digi.com> Hello Adrian, Thanks for the answer and your effort on this. I have been looking for the rewrite code but folder is empty, I can?t find any code there. Where can I get the rewrite code from? Thanks in advance! -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Adrian Crum Sent: Monday, October 11, 2010 16:52 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) The JVM crashes are most likely caused by an uncaught exception thrown in native code. That is a problem I corrected in the rewrite. If you are running on Windows you can give the rewrite a try. -Adrian --- On Mon, 10/11/10, Escalona, David wrote: From: Escalona, David Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) To: "'rxtx at qbang.org'" Date: Monday, October 11, 2010, 2:07 AM Thanks for the answer, I tried all your suggestions but it is still crashing. I don?t know what is wrong as I do not understand the crash log. Is there any way to know exactly what is causing the crash? Is it possible to convert that crash into a java exception? (Really, this could be a show stopper for us). Thanks in advance. -- David Escalona From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of M.Dec-GM Sent: Wednesday, October 06, 2010 12:41 To: rxtx at qbang.org Subject: Re: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hi, 1. Try with newer Java (probably will not help) 2. Try with another USB-RS dongle (VCP hardware & drivers Vendor) - may helps 3. Check if USB isn't going automatically to power saving mode - most often problem with USB VCP and Laptops -> switch it off. Check it even if desktop 4. Check drivers's latency (Port settings -> Advanced), try with shorter (not all HW/SW have this possibility). 5. Let us know about results Regards Mariusz ----- Original Message ----- From: Escalona, David To: 'rxtx at qbang.org' Sent: Wednesday, October 06, 2010 11:50 AM Subject: [Rxtx] Random JVM crash while writing data to serial port (USBreally) Hello all, Since several months I am experiencing a JVM random crash while writing data to Serial Port (USB in this case). I have tried with the 2.2pre with same results. I am attaching a JVM crash log so you can take a look. All crashes are the same, so are logs. Don?t know what am I doing wrong or the reason of the crash. Hope you can help me. Thanks. -- David Escalona ________________________________ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -----Inline Attachment Follows----- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.leusmann at rwth-aachen.de Fri Oct 15 08:22:13 2010 From: philipp.leusmann at rwth-aachen.de (Philipp Leusmann) Date: Fri, 15 Oct 2010 16:22:13 +0200 Subject: [Rxtx] Data out of sync after a while Message-ID: <9A10074B-466D-4817-8964-D43CB73EA3B9@rwth-aachen.de> Hi all, when retrieving continuous data in a loop from my serial connection I notice unexpected data patterns after some amount of time. I guess there is some internal queue overflowing if I do not collect data fast enough. Is there any chance to retrieve information regarding the fill level of the internal buffer? Could anybody explain the mechanisms to me? Is that part of the OS or the serial driver (FTDI serial over USB driver, in my case) Thanks, Philipp From rjl at third-monday.com Wed Oct 20 13:46:07 2010 From: rjl at third-monday.com (Russ) Date: Wed, 20 Oct 2010 14:46:07 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open Message-ID: <20101020193003.M36040@www.third-monday.com> I'm using RXTXSerial library in an Eclipse-based RCP application. It works well while in development mode (e.g., running my application from within Eclipse). But when I export the application and try to run it, I'm getting some bizarre error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll files are in my exported application. Here is the logging output from the application. I'm using Java 1.6.0_20 INFO : Stable Library INFO : ========================================= INFO : Native lib Version = RXTX-2.1-7 INFO : Java lib Version = RXTX-2.1-7 ERROR : java.lang.NoSuchFieldError: pid ERROR : at gnu.io.RXTXPort.open(Native Method) ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) ERROR : at .SerialImpl.connect(SerialImpl.java:96) ERROR : java.lang.NoSuchFieldError: fd ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) ERROR : Exception in thread "Thread-5" ERROR : java.lang.NoSuchMethodError: sendEvent ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) ERROR : at gnu.io.mb.run(mb.java:21) My code: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); if ( portIdentifier.isCurrentlyOwned() ) { throw new DeviceException ("ERROR: Port is currently in use"); } else { // Open port with t/o on operation of 2 seconds. CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if ( commPort instanceof SerialPort ) { port = (SerialPort) commPort; port.setSerialPortParams( params.getBaudRate(), params.getDataBits(), params.getStopBits(), params.getParity()); port.setDTR(true); in = port.getInputStream(); out = port.getOutputStream(); } } Ideas? -- From rjl at third-monday.com Wed Oct 20 15:10:49 2010 From: rjl at third-monday.com (Russ Loucks) Date: Wed, 20 Oct 2010 16:10:49 -0500 Subject: [Rxtx] RXTXSerial throwing NoSuchFieldError on open In-Reply-To: <20101020193003.M36040@www.third-monday.com> References: <20101020193003.M36040@www.third-monday.com> Message-ID: <0165228A-3E3D-4A70-A285-65E455C129E3@third-monday.com> I think I may have resolved this. I downloaded the source code of the version I'm using (2.1-7) and built a new RXTXcomm.jar file with some debugging enabled and installed that jar file and it worked..... I'm guessing the problem had to do with the RXTXcomm.jar file built with a Java JDK incompatible with 1.6.0..... Whew. On Oct 20, 2010, at 2:46 PM, Russ wrote: > I'm using RXTXSerial library in an Eclipse-based RCP application. It works > well while in development mode (e.g., running my application from within Eclipse). > > But when I export the application and try to run it, I'm getting some bizarre > error. I checked and verified that yes, the RXTXComm.jar and rxtxSerial.dll > files are in my exported application. Here is the logging output from the > application. > > I'm using Java 1.6.0_20 > > INFO : Stable Library > INFO : ========================================= > INFO : Native lib Version = RXTX-2.1-7 > INFO : Java lib Version = RXTX-2.1-7 > ERROR : java.lang.NoSuchFieldError: pid > ERROR : at gnu.io.RXTXPort.open(Native Method) > ERROR : at gnu.io.RXTXPort.(RXTXPort.java:279) > ERROR : at gnu.io.RXTXCommDriver.a(RXTXCommDriver.java:194) > ERROR : at gnu.io.CommPortIdentifier.a(CommPortIdentifier.java:84) > ERROR : at .SerialImpl.connect(SerialImpl.java:96) > ERROR : java.lang.NoSuchFieldError: fd > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > ERROR : Exception in thread "Thread-5" > ERROR : java.lang.NoSuchMethodError: sendEvent > ERROR : at gnu.io.RXTXPort.eventLoop(Native Method) > ERROR : at gnu.io.mb.run(mb.java:21) > > > My code: > > CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("COM3"); > > if ( portIdentifier.isCurrentlyOwned() ) { > throw new DeviceException ("ERROR: Port is currently in use"); > } else { > > // Open port with t/o on operation of 2 seconds. > CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); > > if ( commPort instanceof SerialPort ) { > port = (SerialPort) commPort; > > port.setSerialPortParams( > params.getBaudRate(), > params.getDataBits(), > params.getStopBits(), > params.getParity()); > port.setDTR(true); > > in = port.getInputStream(); > out = port.getOutputStream(); > } > } > > Ideas? > > -- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ---- Russ Loucks mailto: rjl at third-monday.com mobile: (612) 205-9171 www.third-monday.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Wed Oct 20 22:50:46 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Wed, 20 Oct 2010 21:50:46 -0700 Subject: [Rxtx] Win7 64bit build? Message-ID: <4CBFC6A6.4000705@CasaDelGato.Com> So, does anyone have a working Win 7 64 bit of rxtx? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From johnny.luong at trustcommerce.com Fri Oct 22 15:37:27 2010 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Fri, 22 Oct 2010 14:37:27 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CBFC6A6.4000705@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> Message-ID: <4CC20417.5010304@trustcommerce.com> John G. Lussmyer wrote: > So, does anyone have a working Win 7 64 bit of rxtx? > Does the 64-bit version found in here not work? http://rxtx.qbang.org/wiki/index.php/Download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Fri Oct 22 15:53:21 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Fri, 22 Oct 2010 14:53:21 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC20417.5010304@trustcommerce.com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> Message-ID: <4CC207D1.3010704@CasaDelGato.Com> Which is the 64-bit version? I don't see that mentioned anywhere. ... so I downloaded the 2.2pre2 file anyway, and it does seem to contain a Win64 build. I hadn't tried that one before yet, as none of the others mentioned anything about Win64. I'll be able to test it later tonight. On 10/22/2010 2:37 PM, Johnny Luong wrote: > John G. Lussmyer wrote: >> So, does anyone have a working Win 7 64 bit of rxtx? >> > > Does the 64-bit version found in here not work? > > http://rxtx.qbang.org/wiki/index.php/Download > http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip From Cougar at CasaDelGato.Com Sat Oct 23 10:26:47 2010 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Sat, 23 Oct 2010 09:26:47 -0700 Subject: [Rxtx] Win7 64bit build? In-Reply-To: <4CC207D1.3010704@CasaDelGato.Com> References: <4CBFC6A6.4000705@CasaDelGato.Com> <4CC20417.5010304@trustcommerce.com> <4CC207D1.3010704@CasaDelGato.Com> Message-ID: <4CC30CC7.9000003@CasaDelGato.Com> Of course, the one annoying thing is that I now get a warning on the console every time I run my app: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 On 10/22/2010 2:53 PM, John G. Lussmyer wrote: > Which is the 64-bit version? I don't see that mentioned anywhere. > ... so I downloaded the 2.2pre2 file anyway, and it does seem to > contain a Win64 build. > I hadn't tried that one before yet, as none of the others mentioned > anything about Win64. > I'll be able to test it later tonight. > > On 10/22/2010 2:37 PM, Johnny Luong wrote: >> John G. Lussmyer wrote: >>> So, does anyone have a working Win 7 64 bit of rxtx? >>> >> >> Does the 64-bit version found in here not work? >> >> http://rxtx.qbang.org/wiki/index.php/Download >> http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From te.steinsland at gmail.com Tue Oct 26 03:23:25 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Tue, 26 Oct 2010 11:23:25 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Hello, I am writing an application that reads accelerometer data sent over the air to a device connected to a USB dongle with a USB to serial port interface. The received data is then plotted live in a graph. If I leave the accelerometer on my desk for some time (>10 minutes), and then start to move the accelerometer again, no more data is read by my application, even though data is still being sent over the air. I have tested this in another application written in C#, and here this problem doesn't occur. Does anybody have some suggestions to how to fix this problem? Best regards, Tor-Erik Steinsland Student - Norwegian University of Science and Technology From Kustaa.Nyholm at planmeca.com Tue Oct 26 04:50:45 2010 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 26 Oct 2010 13:50:45 +0300 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: Message-ID: > > Does anybody have some suggestions to how to fix this problem? > Many people, including me, use rxtx successfully, so the presumption is that it [rxtx] works, at least up to a point. Thus the 'usual suspect' is your code. Posting the relevant port of your code will help people to analyze the problem. Also telling people what OS/version (probably Windows as you mention #C) and what rxtx/version you are using are basic info that people need to help you. It could also be helpful to describe your set up in more detail. For example what sort of handshake or protocol is used. br Kusti From drrobison at openroadsconsulting.com Tue Oct 26 07:29:05 2010 From: drrobison at openroadsconsulting.com (David R Robison) Date: Tue, 26 Oct 2010 09:29:05 -0400 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time Message-ID: <4CC6D7A1.70103@openroadsconsulting.com> On my 32 bit Windows Vista machine CommPortIdentifier.getPortIdentifiers() is taking almost 11 seconds to return. Is there anyway I can improve on this time? Thanks, David -- David R Robison Open Roads Consulting, Inc. 103 Watson Road, Chesapeake, VA 23320 phone: (757) 546-3401 e-mail: drrobison at openroadsconsulting.com web: http://openroadsconsulting.com blog: http://therobe.blogspot.com book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately. From adrian.crum at yahoo.com Tue Oct 26 08:04:53 2010 From: adrian.crum at yahoo.com (Adrian Crum) Date: Tue, 26 Oct 2010 07:04:53 -0700 (PDT) Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: <147828.15856.qm@web63108.mail.re1.yahoo.com> If you don't need the port discovery feature, you can specify the ports to use in the gnu.io.rxtx.properties file. -Adrian --- On Tue, 10/26/10, David R Robison wrote: > From: David R Robison > Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time > To: rxtx at qbang.org > Date: Tuesday, October 26, 2010, 6:29 AM > On my 32 bit Windows Vista machine > CommPortIdentifier.getPortIdentifiers() is taking almost 11 > seconds to return. Is there anyway I can improve on this > time? Thanks, David > > -- > David R Robison > Open Roads Consulting, Inc. > 103 Watson Road, Chesapeake, VA 23320 > phone: (757) 546-3401 > e-mail: drrobison at openroadsconsulting.com > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526 > > This e-mail communication (including any attachments) may > contain confidential and/or privileged material intended > solely for the individual or entity to which it is > addressed.? If you are not the intended recipient, you > should immediately stop reading this message and delete it > from all computers that it resides on. Any unauthorized > reading, distribution, copying or other use of this > communication (or its attachments) is strictly > prohibited.? If you have received this communication in > error, please notify us immediately. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From msemtd at googlemail.com Tue Oct 26 10:46:59 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 26 Oct 2010 17:46:59 +0100 Subject: [Rxtx] CommPortIdentifier.getPortIdentifiers() takes a long time In-Reply-To: <4CC6D7A1.70103@openroadsconsulting.com> References: <4CC6D7A1.70103@openroadsconsulting.com> Message-ID: In gnu.io.RXTXCommDriver.registerScannedPorts(int) one can see if(osName.toLowerCase().indexOf("windows") != -1 ){ String[] temp = new String[259]; for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } CandidateDeviceNames=temp; } I seem to remember it then attempts to open each port with a timeout. Not quick! Like others recommend: use a list of ports obtained from elsewhere! Regards, Michael Erskine. From te.steinsland at gmail.com Wed Oct 27 03:18:47 2010 From: te.steinsland at gmail.com (Tor-Erik Steinsland) Date: Wed, 27 Oct 2010 11:18:47 +0200 Subject: [Rxtx] RXTX based application freezes after some time Message-ID: Thank you for your quick response. Ill try to answer your questions. OS: WinXP RXTX version: 2.1-7r2 (downloaded from here: http://rxtx.qbang.org/wiki/index.php/Download) Protocol: Bluetooth low energy. Its infeasible to provide all my source code, as the whole application is about 30 classes. But Ill provide extracts from the receiving side (Receiver.java and SerialReader.java) SerialReader.java /** * This method starts the thread. Notifies the ReceiverClass when data has arrived. */ public void run(){ receiver.setReader(this); ArrayList dataList = new ArrayList(); while(go){ try{ Thread.sleep(500); int data = -1; if(go){ data = this.inputStream.read(); } while(data != -1){ // System.out.print(Integer.toHexString(data)+" "); dataList.add(data); data = this.inputStream.read(); if(data == -1){ this.receiver.setInputBuffer(dataList); this.receiver.notifyDataArrivedDataArrived(true); dataList.clear(); break; } } } catch(IOException e){ e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } try { this.inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } Receiver.java /** * This method is called by the underlying SerialReader. If the given boolean is true, this method calls * notiftAll() to wake up the current thread. * @param dataArrived boolean indicating whether data ha arrived. */ public synchronized void notifyDataArrivedDataArrived(boolean dataArrived){ this.dataArrived = dataArrived; if(dataArrived){ notifyAll(); } } /** * This method is called by the underlying receiver process to set the inputbuffer with received data. * @param dataList ArrayList holding received bytes. */ public void setInputBuffer(ArrayList dataList){ int[] tmpInputBuffer = new int[dataList.size()]; for(int i = 0; i Message-ID: <4C8BCC2E2F5D42AAA2CA3937E7EBF0DD@mdam2> Hi, I have no time for know to analyse your code, sorry. But this is possible that problems are because of: > > Protocol: Bluetooth low energy. > This is similar, I think: I have observed many times a lot of problem with VCP drivers when energy saving feature (USB may be switched off for energy saving when inactive - Device manager, USB controllers/ bus or something like that - I don't remember exact english names). Switch this feature off in Device manager and look what will after that. Regards Mariusz From msemtd at googlemail.com Wed Oct 27 04:58:17 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Wed, 27 Oct 2010 11:58:17 +0100 Subject: [Rxtx] RXTX based application freezes after some time In-Reply-To: References: Message-ID: On 27 October 2010 10:18, Tor-Erik Steinsland wrote: > ? ? ? ? ? ? ? ?while(go){ There's your problem! Study your management of these control variables. I don't think there's any guarantee of a read returning -1 (EOF) either. Personally I prefer to use serial events -- a strategy that hasn't failed me yet! Regards, Michael Erskine. From jesper.berglund at pertexo.se Wed Oct 27 08:05:53 2010 From: jesper.berglund at pertexo.se (Jesper Berglund) Date: Wed, 27 Oct 2010 16:05:53 +0200 Subject: [Rxtx] Rxtx on Windows 7 professional 64 bit Message-ID: <4CC831C1.3070809@pertexo.se> Hi all. I am trying to get rxtx to work but I fail miserable. The only rxtxSerial.dll I can get to work I have downloaded from rxtx.cloudhopper.com . I am working on a Windows 7 Professional 64 bit environment and uses java 1.6.21 64 bit version. I am trying to use RXTX-2.2pre2. I have added the rxtxserial.dll in the jdk/jre/bin dir and when I launch the jvm and try to connect I get this output in the console: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 When I write to the ouput buffer, it takes forever. More like its trying to write but there is a timout instead of successful write. I then proceed to listen for input in the inputstream and there it hangs forever. Does this ring a bell to anyone? When I use the cloudhopper compiled rxtx everything is working fine, except that it crashes my VM once in a while which is quite annoying. As I surfed the mailing list for anyone with similar problems I read that the rxtx lib is sensetive to which threads that are executing against it and it is generally better to have one thread per port. Can anyone confirm this? Does this has to do with the potential multithreading bugs in the rxtxserial.dll? Best Regards /Jesper Berglund From jithu.mada at gmail.com Thu Oct 28 17:22:12 2010 From: jithu.mada at gmail.com (jithu mada) Date: Thu, 28 Oct 2010 19:22:12 -0400 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: Hi, I have a application which needs to read list of barcode's scanned through a COM port. The java version we are using is 1.6, OS is Windows XP and here is RXTX information Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 and I have copied the rxtxSerial.dll in jre/bin folder and RXTXComm.jar in the jre/lib/ext folder. But when we scan the barcodes we are not receiving any data through the COM port, however we see the data through a sniffer software and also through putty. Here is my source code which opens connection to the COM port and tries to read from it public void open(String device) throws AresException { logger.info("Inside Muliscan open port method"); portName = device; try { /* Get the port identifier for port */ logger.info("Trying to get the port id for port "+portName); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName); logger.info("Successfully got the port id"); /* Actually open the port */ logger.info("Trying to open the port"); port = (SerialPort)portId.open(APPNAME, WAITTIMEOUT); logger.info("Successfully opened the port "+port); if (debug) { dumpBits(); } /* Set the serial ports parameters for the Duplo */ port.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); output = port.getOutputStream(); input = port.getInputStream(); /* * Create a new thread to read the input stream. The * thread is not started until the open method is * called. The setDaemon method allows the Java * Virtual Machine to exit even though this thread is * still running. */ reader = new Thread(this); reader.setDaemon(true); logger.info("Created new thread to read input stream"); /* * Start the reader thread to read bytes from the * duplo */ reader.start(); } catch (Exception e) { logger.info("Exception occurred when trying to open the port"); throw new AresException(e.getMessage()); }catch(Error err) { throw new AresException(err.getMessage()); } } public void run() { /* * Reset the threadStop variable to false so the run loop * will execute. */ threadStop = false; try { StringBuffer sb = new StringBuffer(); boolean noRead = false; while(!threadStop) { int c = input.read(); running = true; if (c == STX) { sb = new StringBuffer(); } else if (c == NULL) { running = false; notify(new AresStatusEvent("Stop", AresStatusEvent.STOP)); } else if (c == CR) { /* * Convert message to a string for * easy processing */ String data = sb.toString(); notify(new AresBarcodeEvent(data)); } else { /* add the byte to input buffer */ sb.append((char)c); } } } catch(Exception e) { System.err.println(e); } } Can any one please tell what could be wrong here? Any sugesstions? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Thu Oct 28 18:05:14 2010 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Thu, 28 Oct 2010 17:05:14 -0700 Subject: [Rxtx] Unable to read from COM port using RXTX Message-ID: <20101028170513.8ef0e5b4a80cef441275a6330ffad77d.aa768d9d76.wbe@email13.secureserver.net> An HTML attachment was scrubbed...