Bluetooth Serial Port Profile and Tcl communications
- From: sv <nathan.selvan@xxxxxxxxx>
- Date: Mon, 8 Dec 2008 12:13:41 -0800 (PST)
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
.
- Follow-Ups:
- Re: Bluetooth Serial Port Profile and Tcl communications
- From: submit
- Re: Bluetooth Serial Port Profile and Tcl communications
- From: Alexandre Ferrieux
- Re: Bluetooth Serial Port Profile and Tcl communications
- Prev by Date: Re: Sharing the socket between 2 threads
- Next by Date: "Best" OO framework for Tcl
- Previous by thread: Sharing the socket between 2 threads
- Next by thread: Re: Bluetooth Serial Port Profile and Tcl communications
- Index(es):
Relevant Pages
|