Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bluetooth serial port problem

203 views
Skip to first unread message

GigiG

unread,
Sep 23, 2016, 6:46:55 AM9/23/16
to
Hi all, I got the same problem here reported:
https://community.activestate.com/forum/bluetooth-serial-port-problem
I have ActiveState Tcl 8.6.1 and a program that try to connect a device with HC-06 module via Bluetooth but the error message is still here:
"couldn't reopen serial 'COM6': invalid argument"
Any suggestion? Thanks
Gigi

Harald Oehlmann

unread,
Sep 23, 2016, 7:35:56 AM9/23/16
to
Hi Gigi,
thank you for the message. The noticed patch by Rolf Schroeter was
incorporated in TCL in 2014-02-25:

https://core.tcl.tk/tcl/tktview/2413550fffffffffffff

Please try at least tcl 8.6.4 or 8.5.17

Enjoy,
Harald

--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---

GigiG

unread,
Sep 23, 2016, 5:48:11 PM9/23/16
to


>
> Please try at least tcl 8.6.4 or 8.5.17
>
> Enjoy,
> Harald
>
>

Yeah, it works with tcl 8.6.4.1. Thanks.
Anyway, it seems that after closing the port with "close $portID" the error go back (invalid argument) and I have to power off and power on the HC-06

GigiG

unread,
Sep 24, 2016, 4:24:51 AM9/24/16
to
> Yeah, it works with tcl 8.6.4.1. Thanks.
> Anyway, it seems that after closing the port with "close $portID" the error go back (invalid argument) and I have to power off and power on the HC-06

After several attempts I can confirm that probably the port is not properly closed. Even if I try to reopen the port with other serial monitor (like Arduino IDE) the port is detected as 'busy'.

Harald Oehlmann

unread,
Sep 27, 2016, 11:28:23 AM9/27/16
to
Please:
- try most resent versions
- file a bug on core.tcl.tk/tcl

This area is difficult, as it dempends on the quality of the virtual com
port driver.

Thank you,

Philip Hoffman

unread,
Sep 29, 2016, 1:17:35 AM9/29/16
to
I'd like to see if I can re-create this issue. I do need the following though:

- information about the specific Bluetooth hardware you are using, including where I can buy it off Amazon.
- A code snippet that reproduces the issue.
- operating system you are using and the version.
- installed any drivers to support the Bluetooth hardware?

I think that about covers it...

Harald Oehlmann

unread,
Sep 29, 2016, 5:13:09 AM9/29/16
to
Philip,

thanks jumping in. I remember you helped at time woth the bug in
tcl8.6.4. Would be glad if you could help now to.

Thanks,

GigiG

unread,
Oct 3, 2016, 3:05:11 AM10/3/16
to
Hi all, after some further attempt it seems that //./COMX or \\.\COMX works fine both in opening/reopening and closing serial ports. COMX alone however sometimes give strange behaviour in reopening. I'm unable to reproduce exactly the symptoms, in fact this was happened when I changed the port number from COM11 to COM6, in order to have COM[1-9]. Anyway noe it works. Thanks.
I will take this opportunity to say that I got another strange behaviour regarding these virtual serial ports. I have a code that uses the following lines:
foreach p $result {; # list of available serial ports
set free [file readable //./$p]
if $free {; # do something ...

It works well if the COM ports availables are physical (USB cables) but using a BT dongle (virtual ports) it takes some time to check (the Tcl application freeze) and [file readable $p] returns zero. Is this normal or I'm using the command the wrong way.

Gigi

Philip Hoffman

unread,
Oct 3, 2016, 7:20:49 PM10/3/16
to
Gigi,

Okay great, using //./COMX or \\.\COMX did work fine for opening and closing on a serial port. Whew!

There is still a bug about it failing with COMX, not sure why the behavior differs (they are all supposed to be recognized as native serial ports). I'll get one filed soon enough.

> I will take this opportunity to say that I got another strange behaviour regarding these virtual serial ports. I have a code that uses the following lines:
> foreach p $result {; # list of available serial ports
> set free [file readable //./$p]
> if $free {; # do something ...
>

What happens if you call open and use catch to see if any errors raise instead of using readable?
0 new messages