Bluetooth Serial Port Profile and Tcl communications



Hello all,

Serial port communications I thought should be fairly straightforward,
but it appears not to be - at least in what I am experiencing. Any
help rendered to get me past this would help. Thanks.

I have a BT-module (Roving Networks RN-41) connected to a processor's
UART. Data is transmitted by the processor and the RN-41 BT module
acts as a pass-through. The data is received over RF by a BT USB
dongle (Dlink DBT-120) connected to a PC running Windows XP SP3).
Under device manager in XP, I see that the RN-41 is recognized as
having a Serial Port profile and assigned a COM number.

When I open Docklight or RS232Comm, I can open the COM and talk to the
remote BT device (query status/address/baud settings, etc.) and also
transfer data bi-directionally. So all appears good there.
I think that validates all aspects of the BT stacks,drivers and
communication channel. I can do this at various baud settings and
everything works just well.

An important point to note here is that I can disconnect and connect
as many times as I want and no problems are noticed. In fact on my BT
module there's a 'link' green LED. When I connect, it comes on green
and goes off when I disconnect. So visually I can tell when the COM
port is opened or closed.

Now when I try this through Tcl ("open COMx: r+" or "open \\\\.\\COMx r
+" or variants of this), I observe a bizzare behavior:

3 out of 5 times, I get either of the following two message screens:
couldn't open serial "\\.\COMx": invalid argument (or)
couldn't reopen serial "\\.\COMx": invalid argument

And the other 2 out of 5 times the following is observed: The device
connects (green LED ON), disconnects immediately (green LED OFF),
connects again, disconnects again and finally connects (green LED ON)
and stays solid. Sometimes this toggling is not 5 times as above, but
only 3 times…ON, OFF, ON.

Now if I try to connect again, 9 out of 10 times, I get a message like
this:
couldn't reopen serial "\\.\COMx": invalid argument
There's no way for me to recover from this, except by power cycling
the BT module (leaving the dongle as is).

Interestingly, there's a very similar (I would say, identical really)
behavior observed by someone using JavaApps (not Tcl). The link is:
http://groups.google.com/group/trackbot/browse_thread/thread/89910d2c97ad42bc
and he is using a completely different BT USB adapter (dongle) and BT
module.

Any pointers on where I ought to look?

Incidentally, I had an off-line discussion with a member of this group
Rolf Schroedter and he rightly suggested that I move this discussion
to this board for getting more people involved and preserve this for
the public should there be others with similar issues. (Thanks Rolf!)
His Tcl serial port monitor ( http://www.rolf-schroedter.de/moni/)
also exhibits a similar behavior as what is detailed above.

Thanks,
-sv


.



Relevant Pages

  • Re: Bluetooth Serial Port Profile and Tcl communications
    ... Serial port communications I thought should be fairly straightforward, ... but it appears not to be - at least in what I am experiencing. ... dongle connected to a PC running Windows XP SP3). ... An important point to note here is that I can disconnect and connect ...
    (comp.lang.tcl)
  • Re: TimeOut Serial Port
    ... > I'm excanging data with an microcontroller (Atmel) via the serial port. ... > If I disconnect my controller, then the programm hangs up in the following ...
    (comp.lang.cpp)
  • Re: Error while reading COM2
    ... It's "The handle is invalid." ... eVC Error Lookup tool. ... you see the serial port name that you're trying to use. ...
    (microsoft.public.windowsce.platbuilder)
  • Serial Port problem
    ... I have a problem in serial port on WinCE 5.0. ... au1uart::HWInit - UnitIndex 3 is invalid ... The registry settings for serial port are as follows: ... ; @CESYSGEN ENDIF COREDLL_SERDEV ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Using Telix to talk to a modem
    ... data over a dial-up ... modem. ... Is XP likely to block the serial port communications? ... Telix talks to the serial port address, not the hardware itself, so it should be fine. ...
    (microsoft.public.windowsxp.general)