Tera Term Macro Examples

I’m using Tera Term for login and work on a server. And, I feel it is annoying to login manually.

Tera Term has the macro functionality. So, it can login to server by only Double Click by some settings.

In this article, I introduce how to auto login by Tera Term macro.

With the loopback in place, type some characters into to Tera Term and see if you can see what you type; if you can, the loopback is passing (good signal up to that point) Need to jumper pins 2 (TX) and 3 (RX) on 25 pin plug/RS232 output of Lantronix box. As you look at pins they number right to left 1-13 on top,14-25 on bottom of plug. Tips and Tricks As you can see, Tera Term is extremely easy to use for serial monitoring, however by default, unless your program prints the entered values back to the terminal, you won’t be able to see the characters entered. To change this, go back to the Terminal setup menu and select ‘Echo Local’. Tera Term Macro language file for GeSHi. This version of ttl.php was created for Tera Term 4.60 and LogMeTT 2.9.4. Newer versions of these application can contain additional Macro commands and/or keywords that are not listed here. The latest release of ttl.php can be downloaded from Download section of LogMeTT.com. Tera Term Language (TTL) TTL is a simple interpreted language like BASIC. To learn TTL quickly, study the sample macro files in the distribution package and the command reference.

【Step1】Associate with macro file(.ttl file)

The macro file extension is “.ttl”. So, to set file association to execute Tera Term macro(ttpmacro.exe) by double click .ttl file.

The following the article is useful, please see.
https://www.lifewire.com/how-to-change-file-associations-in-windows-2624477

Tera term macro examples geometry
【Step2】Create macro file(.ttl file)

This is a sample .ttl file.

Macro

Change the following setting depending on your environment.

  • username:User name to login
  • password:User password
  • hostname:Server host name or IP address
  • logfilename:Log file name (entered command and output is written)
  • /auth:How to authenticate
  • logdir:Output folder of log fil
Tera Term Macro Examples

Create .ttl file, then double click to check login to server!!

…((((*ФωФ)ノ Go Go ♪

PC based Tera-term macro or Python script example to send a “GET” using DNS lookup to a HTTP Server.

  1. Down load Tera Term
  2. Connect the eS-Wifi module to the PC
  3. Setup the comm port and Tera Term terminal with Transmit and Receive with CR+LF
  4. Edit the Macro with your router with ssid, password, security type
  5. Under the Tera-Term “Control” drop down menu select “Macro” and point to unzip HTTP macro below.

Recommended tools:

  1. Teraterm
  2. HTTP Get Macro (zip) or see code below
  3. eS-WiFi drivers ( easily installed using ourPC demo application (ZIP)

Tera Term Commands

Optional tools:

If you prefer Python – Python example

—————————————————————————-

Teraterm Macro – Setup, Terminal, New-Line should be set to CR+LF for both Receive & Transmit

;Fill in your ssid and password
SSID=””
PSWD=””

sendln ‘C1=’SSID
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

sendln ‘C2=’PSWD
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

sendln ‘C3=4’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

sendln ‘C0’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

;Default Remote port, [P4]
port = ’80’

;Protocol
proto = ‘0’

;Packet
;get//http://urlecho.appspot.com/echo?status=200&Content-Type=text%2Fhtml&body=Hello%20world
Pkt0 = ‘GET /echo?status=200&Content-Type=text%2Fhtml&body=Hello%20world HTTP/1.1’#$D#$A
Pkt1 = ‘Host: urlecho.appspot.com’#$D#$A’Connection: close’#$D#$A#$D#$A
;All HTTP request end in 1 blank line
dispstr Pkt0

sendln ‘I?’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

sendln ‘R1=1460
wait ‘OK’ ‘ERROR’
if result=2 goto cerror
sendln ‘R2=10000’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

Tera Term Macro Examples

sendln ‘R?’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

sendln ‘S2=100’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

sendln ‘S?’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

;Protocol settings
sendln ‘P?’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror
;Setup
sendln ‘P1=’proto
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

sendln ‘D0=urlecho.appspot.com’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

sendln ‘P4=’ port
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

sendln ‘P?’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror
;Connect
sendln ‘P6=1’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

;Send
send ‘S3=124’#$D Pkt0 Pkt1
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

Tera Term Macro Serial Example

;Receive
sendln ‘R0’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

;Disconnect
sendln ‘P6=0’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror
;Jump to end
goto cend

Tera Term Macro Examples Synonyms

;Command Error
:cerror
dispstr #13#10#10′[SCRIPT ] ***** Command Failed *****’#13#10#10′> ‘

;Exit
:cend
sendln ‘P6=0’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror

Teraterm Macro Examples Serial Port

sendln ‘CD’
wait ‘OK’ ‘ERROR’
if result=2 goto cerror