• Support
  • Articles
  • Resources
  • Products
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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 494: 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
[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

How to connect to USB Serial COM port?

Moderator: boris

  • 1
  • 2

29 postsPage 1 of 2

JamesL
Newbie

Posts:
16
Joined: Wed Aug 31, 2016 7:20 pm
by JamesL » Wed Aug 31, 2016 7:58 pm

Attachments

Serial COM.png
Serial COM.png (32.63 KiB) Viewed 1981 times
JamesL
Newbie

Posts:
16
Joined: Wed Aug 31, 2016 7:20 pm
by JamesL » Thu Sep 01, 2016 3:31 pm
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.
IshmaelCallMe
Guru

Posts:
673
Joined: Thu Jan 26, 2006 2:28 am
by IshmaelCallMe » Fri Sep 02, 2016 4:44 pm
Probably easiest to try each COM port and then stay with the first one that actually responds with a login prompt (or whatever)
JamesL
Newbie

Posts:
16
Joined: Wed Aug 31, 2016 7:20 pm
by JamesL » Tue Sep 06, 2016 6:34 pm
IshmaelCallMe
Guru

Posts:
673
Joined: Thu Jan 26, 2006 2:28 am
by IshmaelCallMe » Mon Sep 12, 2016 2:12 pm
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.
JamesL
Newbie

Posts:
16
Joined: Wed Aug 31, 2016 7:20 pm
by JamesL » Mon Sep 12, 2016 6:49 pm
IshmaelCallMe
Guru

Posts:
673
Joined: Thu Jan 26, 2006 2:28 am
by IshmaelCallMe » Mon Sep 12, 2016 7:29 pm
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.
JamesL
Newbie

Posts:
16
Joined: Wed Aug 31, 2016 7:20 pm
by JamesL » Mon Sep 12, 2016 7:32 pm
It might be helpful if I could look at the source code for the Tera Term Macros.
JamesL
Newbie

Posts:
16
Joined: Wed Aug 31, 2016 7:20 pm
by JamesL » Tue Sep 13, 2016 2:10 pm
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.
IshmaelCallMe
Guru

Posts:
673
Joined: Thu Jan 26, 2006 2:28 am
by IshmaelCallMe » Tue Sep 13, 2016 3:17 pm
JamesL
Newbie

Posts:
16
Joined: Wed Aug 31, 2016 7:20 pm
by JamesL » Tue Sep 13, 2016 3:48 pm
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.
JamesL
Newbie

Posts:
16
Joined: Wed Aug 31, 2016 7:20 pm
by JamesL » Tue Sep 13, 2016 4:17 pm
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)?
JamesL
Newbie

Posts:
16
Joined: Wed Aug 31, 2016 7:20 pm
by JamesL » Tue Sep 13, 2016 5:29 pm
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?
JamesL
Newbie

Posts:
16
Joined: Wed Aug 31, 2016 7:20 pm
by JamesL » Tue Sep 13, 2016 5:39 pm
Actually if AutoIt could select the right COM port from the Serial port setup window, that would be fine too
IshmaelCallMe
Guru

Posts:
673
Joined: Thu Jan 26, 2006 2:28 am
by IshmaelCallMe » Tue Sep 13, 2016 10:32 pm
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.
IshmaelCallMe
Guru

Posts:
673
Joined: Thu Jan 26, 2006 2:28 am
by IshmaelCallMe » Tue Sep 13, 2016 10:38 pm
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.
JamesL
Newbie

Posts:
16
Joined: Wed Aug 31, 2016 7:20 pm
by JamesL » Wed Sep 14, 2016 2:18 pm
IshmaelCallMe
Guru

Posts:
673
Joined: Thu Jan 26, 2006 2:28 am
by IshmaelCallMe » Wed Sep 14, 2016 5:08 pm
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.
JamesL
Newbie

Posts:
16
Joined: Wed Aug 31, 2016 7:20 pm
by JamesL » Wed Sep 14, 2016 6:25 pm
IshmaelCallMe
Guru

Posts:
673
Joined: Thu Jan 26, 2006 2:28 am
by IshmaelCallMe » Wed Sep 14, 2016 7:48 pm
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.
JamesL
Newbie

Posts:
16
Joined: Wed Aug 31, 2016 7:20 pm
by JamesL » Fri Sep 16, 2016 3:25 pm
Is there a way to do it using only AutoIt and the Tera Term macro? I'd prefer not to use enumser
boris
Moderator, LogMeTT and TTLEditor developer

Posts:
1597
Joined: Sat Jan 08, 2005 2:52 pm
by boris » Fri Sep 16, 2016 4:43 pm
Check is this is something that can help http://logmett.com/support-forums/3/nee ... HELL#p8935
Thanks.
Best regards,
Boris
JamesL
Newbie

Posts:
16
Joined: Wed Aug 31, 2016 7:20 pm
by JamesL » Fri Sep 16, 2016 9:35 pm
IshmaelCallMe
Guru

Posts:
673
Joined: Thu Jan 26, 2006 2:28 am
by IshmaelCallMe » Fri Sep 16, 2016 11:45 pm
Display posts from previous:
Sort by:
  • 1
  • 2

29 postsPage 1 of 2

Users browsing this forum: No registered users