[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rxtx
Subject:    Re: [Rxtx] Problem opening serial port in multithreaded application
From:       Trent Jarvi <tjarvi () qbang ! org>
Date:       2009-07-02 0:04:37
Message-ID: alpine.LFD.2.00.0907011800230.19690 () rxtx ! qbang ! org
[Download RAW message or body]


A reboot required suggests a kernel driver issue.  I've seen problems with 
drivers on windows systems involving bluetooth devices that are presented 
as serial ports.

I can imagine it is difficult to present a connection as a device.  I've 
only run into a couple drivers that do it well.  The hang may be 
associated with establishing the connection which is triggered by the 
open call.

I've had luck with the lego mindstorm bluetooth driver/dongles.  I think 
that claims to work with Macs as well.

I would suggest following up with the vendor as well.  We had problems 
with plain USB<->Serial dongles early on but vendors reacted well.

On Wed, 1 Jul 2009, Charlie Meyer wrote:

> Ive traced down the problem a bit, maybe this might help someone shed some
> light on what is going on for me.
> 
> My application's desired behavior is to scan for all available serial ports
> and then start io on the ones that are available at runtime. To accomplish
> the first task, I was using code that was almost identical to the code on
> the wiki:
> 
> http://rxtx.qbang.org/wiki/index.php/Discovering_available_comm_ports
> 
> Each subsequent open of a port that was opened/closed in the discovery phase
> caused the system to hang. When i removed the open/close lines for each
> found serial port, everything worked just fine.
> 
> Is there a reason why an open/close/open operation on a serial port would
> cause my application to lockup?
> 
> Charlie Meyer
> 
> Department of Computer Science
> University of Illinois at Urbana-Champaign
> 
> 
> On Wed, Jul 1, 2009 at 12:58, Andre-John Mas <ajmas@sympatico.ca> wrote:
>       I was just reading some stuff on the Darwin-dev mailing list and
>       came across this:
>
>       http://lists.apple.com/archives/Darwin-dev/2009/Jun/msg00096.html
>
>       Note sure whether it is of any relevance?
>
>       Andre
> 
> 
> On 1-Jul-2009, at 13:51, Charlie Meyer wrote:
> 
> Hi,
> 
> Im trying to open a bluetooth serial port from a multithreaded
> application, but when the following line of code gets run:
> 
> SerialPort serialPort =
> (SerialPort)portId.open(SerialComm.class.getName(),2000);
> 
> the application completely locks up and will not exit normally.
> The system requires a reboot (forcibly, using the power button)
> to close the application. Ive done a bit of debugging, and have
> traced it to the native call to open in RXTXPort, but havnt
> traced it any further. Is there a way to further debug the
> native methods to see what is happening?
> 
> The strange thing is when I create a simple main method that
> only opens up the serial port and does some basic io, it works
> perfectly, but running the exact same methods in the
> multithreaded application causes RXTX to hang.
> 
> Im running Mac OS X 10.5 with Java 1.6, using rxtx 2.2pre2 with
> the 64 bit version of the native libraries found on the wiki.
> 
> If anyone knows whats going on with my setup or has guidance on
> next steps to take to solve the problem, it would be very
> grateful.
> 
> Thanks
> 
> Charlie Meyer
> 
> charlie@charliemeyer.net
> 
> Department of Computer Science
> University of Illinois at Urbana-Champaign
> _______________________________________________
> Rxtx mailing list
> Rxtx@qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
> 
> 
> 
> 
>
_______________________________________________
Rxtx mailing list
Rxtx@qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic