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

[ open COM4: ] problems on Win10

128 views
Skip to first unread message

Les Cargill

unread,
Aug 1, 2017, 9:38:01 PM8/1/17
to
Running 8.6.4 off ActiveState

Here's what's weird:

- If I just run tclsh from a command line, I can open the port[1].
- In a proc within a script, it fails.


[1] it's an Arudino connected via USB trying to be a serial port. Works
well on Win7.

Where's a good place to look for solutions?

--
Les Cargill

Ralf Fassel

unread,
Aug 2, 2017, 3:58:02 AM8/2/17
to
* Les Cargill <lcarg...@comcast.com>
| Running 8.6.4 off ActiveState
>
| Here's what's weird:
>
| - If I just run tclsh from a command line, I can open the port[1].
| - In a proc within a script, it fails.

Can you show the code you use?
Can you show the exact error message of the failure?

R'

Les Cargill

unread,
Aug 2, 2017, 2:45:20 PM8/2/17
to
Ralf Fassel wrote:
> * Les Cargill <lcarg...@comcast.com>
> | Running 8.6.4 off ActiveState
>>
> | Here's what's weird:
>>
> | - If I just run tclsh from a command line, I can open the port[1].
> | - In a proc within a script, it fails.
>
> Can you show the code you use?

It is exactly the same line of code for both cases. I cut and
paste it to a Tcl interpreter for the test.

> Can you show the exact error message of the failure?
>

Essentially "file doesn't exist" The following is a recreation:

% set f [ open "COM4:" "r+" ]
couldn't open "COM4:": no such file or directory
%


> R'
>

I'll do a more thorough followup later.

--
Les Cargill

Gerald Lester

unread,
Aug 2, 2017, 3:41:00 PM8/2/17
to
Are you sure it is called COM4 on both machines at all times (once had a
USB serial connected that every time it was "disconnected", either via
software or hardware, and reconnected it got a new port number -- and
the driver thought a [close] was a disconnect)

--
+----------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald...@kng-consulting.net |
+----------------------------------------------------------------------+

Les Cargill

unread,
Aug 2, 2017, 5:17:36 PM8/2/17
to
Gerald Lester wrote:
> On 08/02/2017 01:48 PM, Les Cargill wrote:
>> Ralf Fassel wrote:
>>> * Les Cargill <lcarg...@comcast.com>
>>> | Running 8.6.4 off ActiveState
>>>>
>>> | Here's what's weird:
>>>>
>>> | - If I just run tclsh from a command line, I can open the port[1].
>>> | - In a proc within a script, it fails.
>>>
>>> Can you show the code you use?
>>
>> It is exactly the same line of code for both cases. I cut and
>> paste it to a Tcl interpreter for the test.
>>
>>> Can you show the exact error message of the failure?
>>>
>>
>> Essentially "file doesn't exist" The following is a recreation:
>>
>> % set f [ open "COM4:" "r+" ]
>> couldn't open "COM4:": no such file or directory
>> %
>>
>>
>>> R'
>>>
>>
>> I'll do a more thorough followup later.
>>
>
> Are you sure it is called COM4 on both machines at all times (once had a
> USB serial connected that every time it was "disconnected", either via
> software or hardware, and reconnected it got a new port number -- and
> the driver thought a [close] was a disconnect)
>

Understood - yes, it's COM4: in both cases. Effectively, when the
script fails, I cut & paste the line with the open and it works in a
tclsh .

I'll have to add detail later.

--
Les Cargill

Ralf Fassel

unread,
Aug 3, 2017, 10:27:51 AM8/3/17
to
* Les Cargill <lcarg...@comcast.com>
| % set f [ open "COM4:" "r+" ]
| couldn't open "COM4:": no such file or directory

Can you try without the trailing colon

set f [ open "COM4" "r+" ]

and see whether this makes a difference? I vaguely remember trailing
colons causing problems in some circumstances on Windows, but the
details are lost...

R'

Robert Heller

unread,
Aug 3, 2017, 2:09:53 PM8/3/17
to
You might also want to force the use of the "global NT object space", esp. if
the port is outside of the range of 1-4 or possibly 1 or 2. You would prefix
the name with "\\\\.\\" ({\\.\}).

>
> R'
>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
hel...@deepsoft.com -- Webhosting Services

Donald Arseneau

unread,
Aug 3, 2017, 11:41:25 PM8/3/17
to
This is clearly done on the tclsh command line, but it
fails. That's not what you said above. You said the failure
only occurs within a proc.



--
Donald Arseneau as...@triumf.ca

Les Cargill

unread,
Aug 4, 2017, 11:32:09 PM8/4/17
to
Yes. I was trying to reproduce the failure so that the exact
text of the error message could be seen. The obvious choice
is to open a port that doesn't exist.

For what it is worth, I was in the middle of using Tcl to
try to get an old friend out of trouble and this error come up.

I can provide well-considered and careful provenance perhaps..
later.

Ain't gonna happen to nite. I can only hope that works for you.

Donald, it's been a hell of a week. So, sorry about that.

--
Les Cargill

Les Cargill

unread,
Sep 9, 2017, 12:49:02 PM9/9/17
to
This got it. WTF, Windows? WTF? Of course even the senior
guys in Redmond now are probably asking "what's a serial port?" . :)

Thanks to all.

--
Les Cargill
0 new messages