[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
LogMeTT.com • How to connect to USB Serial COM port?
Page 1 of 2

How to connect to USB Serial COM port?

Posted: Wed Aug 31, 2016 7:58 pm
by JamesL

Re: How to connect to USB Serial COM port?

Posted: Thu Sep 01, 2016 3:31 pm
by JamesL
In this case, the USB serial adapter has COM port 10, but this is not always the case.

My computer has 5 default valid COM channels (COM1- COM5), but I can't assume that will be true for other people who will be running the macro.

I would prefer to have something that goes from COM1 to COM256 (MaxComPort=256 in TERATERM.ini), and selects the first valid COM port that has the USB Serial Port description, as seen in the selection menu.

Re: How to connect to USB Serial COM port?

Posted: Fri Sep 02, 2016 4:44 pm
by IshmaelCallMe
Probably easiest to try each COM port and then stay with the first one that actually responds with a login prompt (or whatever)

Re: How to connect to USB Serial COM port?

Posted: Tue Sep 06, 2016 6:34 pm
by JamesL

Re: How to connect to USB Serial COM port?

Posted: Mon Sep 12, 2016 2:12 pm
by IshmaelCallMe
I am sure you could do it with an AutoIt script, but I don't think a pure TeraTERM script would be able to do what you describe then.

Re: How to connect to USB Serial COM port?

Posted: Mon Sep 12, 2016 6:49 pm
by JamesL

Re: How to connect to USB Serial COM port?

Posted: Mon Sep 12, 2016 7:29 pm
by IshmaelCallMe
Yep, just verified that Autoit can indeed read the "USB Serial Port" from the New Connection menu. It can only read the currently selected one, so it would have to scroll thru them all, but a script could do that faster than a user can see it happen.

Re: How to connect to USB Serial COM port?

Posted: Mon Sep 12, 2016 7:32 pm
by JamesL
It might be helpful if I could look at the source code for the Tera Term Macros.

Re: How to connect to USB Serial COM port?

Posted: Mon Sep 12, 2016 7:56 pm
by IshmaelCallMe

Re: How to connect to USB Serial COM port?

Posted: Tue Sep 13, 2016 2:10 pm
by JamesL
Thanks for the info. Now I just gotta figure out how to use AutoIt to detect the USB Serial Port text as well as realize that (in this case) the COM port number we want is 10, which should just be some simple text parsing.

Re: How to connect to USB Serial COM port?

Posted: Tue Sep 13, 2016 3:17 pm
by IshmaelCallMe

Re: How to connect to USB Serial COM port?

Posted: Tue Sep 13, 2016 3:48 pm
by JamesL
Thanks!

Does that select the USB Serial Port COM channel from the New Connection window?

I would prefer using callmenu to open up the New Connection window only to identify the COM that corresponds to USB Serial Port.

Then I would use callmenu again to open up the Serial port setup window and actually switch to the correct USB COM. That way Tera Term macro logging still works.

Re: How to connect to USB Serial COM port?

Posted: Tue Sep 13, 2016 4:17 pm
by JamesL
Also looks like AutoIt can read from the window. Is there some way to extract the COM port number associated with USB Serial Port (in this case 10)?

Re: How to connect to USB Serial COM port?

Posted: Tue Sep 13, 2016 5:29 pm
by JamesL
The AutoIt script would have to somehow transfer the information about which COM port number corresponds to USB Serial Port back to the macro that called it. So in this case AutoIt would have to communicate "10" to the macro that calls it. Is there a way to do this?

Re: How to connect to USB Serial COM port?

Posted: Tue Sep 13, 2016 5:39 pm
by JamesL
Actually if AutoIt could select the right COM port from the Serial port setup window, that would be fine too

Re: How to connect to USB Serial COM port?

Posted: Tue Sep 13, 2016 10:32 pm
by IshmaelCallMe
The script as given should auto select the first port with "USB Serial Port" in it. You can always start the log with the "logopen" TeraTERM script command, or set auto logging in the ini file. You will have to have AutoIT installed on each PC, or compile the AutoIT script into a exe and distribute (and call) the exe.

Re: How to connect to USB Serial COM port?

Posted: Tue Sep 13, 2016 10:38 pm
by IshmaelCallMe
You might want to add some error checking such that if it doesn't find a appropriate port it will error out. Right now it will just loop forever. I will leave that as an exercise .... :smile:

Hint: See if it gets the exact same text twice in a row.

Re: How to connect to USB Serial COM port?

Posted: Wed Sep 14, 2016 2:18 pm
by JamesL

Re: How to connect to USB Serial COM port?

Posted: Wed Sep 14, 2016 5:08 pm
by IshmaelCallMe
Even simpler, dump http://www.naughter.com/enumser.html into a file and parse it, then open the correct COM with the 'connect' macro command.

Re: How to connect to USB Serial COM port?

Posted: Wed Sep 14, 2016 6:25 pm
by JamesL

Re: How to connect to USB Serial COM port?

Posted: Wed Sep 14, 2016 7:48 pm
by IshmaelCallMe
Yes, it will allow connection in the current TeraTERM window

Dump output of above tool into a file.
Use macro to read and parse file.
Macro opens correct COM with connect.

Re: How to connect to USB Serial COM port?

Posted: Fri Sep 16, 2016 3:25 pm
by JamesL
Is there a way to do it using only AutoIt and the Tera Term macro? I'd prefer not to use enumser

Re: How to connect to USB Serial COM port?

Posted: Fri Sep 16, 2016 4:43 pm
by boris
Check is this is something that can help http://logmett.com/support-forums/3/nee ... HELL#p8935

Re: How to connect to USB Serial COM port?

Posted: Fri Sep 16, 2016 9:35 pm
by JamesL

Re: How to connect to USB Serial COM port?

Posted: Fri Sep 16, 2016 11:45 pm
by IshmaelCallMe