Teraterm Script Serial Port



  1. Teraterm Script Serial Port Angeles
  2. Teraterm Macro Command
  3. Teraterm Macro Examples
  4. Teraterm Script Serial Port Example

Miniterm¶

Miniterm is now available as module instead of example.see serial.tools.miniterm for details.

miniterm.py
The miniterm program.
setup-miniterm-py2exe.py
This is a py2exe setup script for Windows. It can be used to create astandalone miniterm.exe.

TCP/IP - serial bridge¶

Basically, I'm trying to write script for TeraTerm that will log into our Cisco switches perform a 'sh run' command and log the output to a text file on the computer running the script (work. Accessing TeraTerm Using Tera Term for RS232 Download TERA TERM if the PC doesn’t have a RS232 program already. Click on Tera Term and a window will pop up asking about a new connection Make sure the bubble is under “Serial”. With TeraTerm running and your Daughtercard connected up to the serial port of the PC, place the Monitor Jumper in place to power up into the HCmon program. See the initial banner as shown above. Enter the 'C' command to Clear user space memory. IMPORTANT: You must immediately follow this command with the L command as directed next.

In Tera Term I use the Serial Port to send commands to the board in order to log in and run certain settings that I want. Instead of typing these commands each time I test a board I want to create a program that sends these commands without the requirement to type them again and again each time.

This program opens a TCP/IP port. When a connection is made to that port (e.g.with telnet) it forwards all data to the serial port and vice versa.

This example only exports a raw socket connection. The next examplebelow gives the client much more control over the remote serial port.

  • The serial port settings are set on the command line when starting theprogram.
  • There is no possibility to change settings from remote.
  • All data is passed through as-is.
tcp_serial_redirect.py
Main program.

Single-port TCP/IP - serial bridge (RFC 2217)¶

Simple cross platform RFC 2217 serial port server. It uses threads and isportable (runs on POSIX, Windows, etc).

  • The port settings and control lines (RTS/DTR) can be changed at any timeusing RFC 2217 requests. The status lines (DSR/CTS/RI/CD) are polled everysecond and notifications are sent to the client.
  • Telnet character IAC (0xff) needs to be doubled in data stream. IAC followedby another value is interpreted as Telnet command sequence.
  • Telnet negotiation commands are sent when connecting to the server.
  • RTS/DTR are activated on client connect and deactivated on disconnect.
  • Default port settings are set again when client disconnects.

New in version 2.5.

rfc2217_server.py
Main program.
setup-rfc2217_server-py2exe.py
This is a py2exe setup script for Windows. It can be used to create astandalone rfc2217_server.exe.

Multi-port TCP/IP - serial bridge (RFC 2217)¶

This example implements a TCP/IP to serial port service that works withmultiple ports at once. It uses select, no threads, for the serial ports andthe network sockets and therefore runs on POSIX systems only.

  • Full control over the serial port with RFC 2217.
  • Check existence of /tty/USB0..8. This is done every 5 seconds usingos.path.exists.
  • Send zeroconf announcements when port appears or disappears (usespython-avahi and dbus). Service name: _serial_port._tcp.
  • Each serial port becomes available as one TCP/IP server. e.g./dev/ttyUSB0 is reachable at <host>:7000.
  • Single process for all ports and sockets (not per port).
  • The script can be started as daemon.
  • Logging to stdout or when run as daemon to syslog.
  • Default port settings are set again when client disconnects.
  • modem status lines (CTS/DSR/RI/CD) are not polled periodically and the servertherefore does not send NOTIFY_MODEMSTATE on its own. However it responds torequest from the client (i.e. use the poll_modem option in the URL whenusing a pySerial client.)

Requirements:

  • Python (>= 2.4)
  • python-avahi
  • python-dbus
  • python-serial (>= 2.5)

Installation as daemon:

  • Copy the script port_publisher.py to /usr/local/bin.
  • Copy the script port_publisher.sh to /etc/init.d.
  • Add links to the runlevels using update-rc.dport_publisher.shdefaults99
  • That’s it :-) the service will be started on next reboot. Alternatively runinvoke-rc.dport_publisher.shstart as root.

New in version 2.5: new example

port_publisher.py
Multi-port TCP/IP-serial converter (RFC 2217) for POSIX environments.
port_publisher.sh
Example init.d script.

wxPython examples¶

A simple terminal application for wxPython and a flexible serial portconfiguration dialog are shown here.

wxTerminal.py
A simple terminal application. Note that the length of the buffer islimited by wx and it may suddenly stop displaying new input.
wxTerminal.wxg
A wxGlade design file for the terminal application.
wxSerialConfigDialog.py
A flexible serial port configuration dialog.
wxSerialConfigDialog.wxg
The wxGlade design file for the configuration dialog.
setup-wxTerminal-py2exe.py
A py2exe setup script to package the terminal application.

Unit tests¶

The project uses a number of unit test to verify the functionality. They allneed a loop back connector. Roses are red funny poems. The scripts itself contain more information. Alltest scripts are contained in the directory test.

The unit tests are performed on port loop:// unless a different devicename or URL is given on the command line (sys.argv[1]). e.g. to run thetest on an attached USB-serial converter hwgrep://USB could be used orthe actual name such as /dev/ttyUSB0 or COM1 (depending on platform).

run_all_tests.py
Collect all tests from all test* files and run them. By default, theloop:// device is used.
test.py
Basic tests (binary capabilities, timeout, control lines).
test_advanced.py
Test more advanced features (properties).
test_high_load.py
Tests involving sending a lot of data.
test_readline.py
Tests involving readline.
test_iolib.py
Tests involving the io library. Only available for Python 2.6 andnewer.
test_url.py
Tests involving the URL feature.
HomeSwitchboardUnix AdministrationRed HatTCP/IP NetworksNeoliberalismToxic Managers
May the source be with you, but remember the KISS principle ;-)
Skepticism and critical thinking is not panacea, but can help to understand the world better
NewsTeratermRecommended LinksSerial Console on Solaris
SSH Password-less SSH loginTelnet protocolsshfs
CygTerm+LogMeTTTipsHumorEtc

An RS-232 serial console servers to be controlled from a terminal or a PC with a terminal emulation program attached to the asynchronous COM1 (or other) serial port.

If your Windows PC doesn’t offer a terminal emulation program (e.g. your PC is running Windows 7), please use Tera Term.

Use the serial setup and set the serial port parameters to 9600 bps (baud rate), 8 data bits, none parity, one stop bit and none handshaking (9600, N, 8, 1).

Please note that Tera Term works also very well as RS-232 terminal emulator. That is all.

Recommended Links

Google matched content

Softpanorama Recommended

Top articles

Sites

Etc

Society

Groupthink :Two Party System as Polyarchy : Corruption of Regulators :Bureaucracies :Understanding Micromanagers and Control Freaks : Toxic Managers : Harvard Mafia :Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience :Who Rules America :Neoliberalism : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace: Skeptical Finance : John Kenneth Galbraith :Talleyrand :Oscar Wilde :Otto Von Bismarck :Keynes :George Carlin :Skeptics :Propaganda : SE quotes : Language Design and Programming Quotes :Random IT-related quotes : Somerset Maugham :Marcus Aurelius :Kurt Vonnegut :Eric Hoffer :Winston Churchill :Napoleon Bonaparte :Ambrose Bierce : Bernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis :Political Skeptic Bulletin, 2013 :Unemployment Bulletin, 2010 : Vol 23, No.10 (October, 2011) An observation about corporate security departments :Slightly Skeptical Euromaydan Chronicles, June 2014 :Greenspan legacy bulletin, 2008 :Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) :Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 :Inequality Bulletin, 2009 :Financial Humor Bulletin, 2008 :Copyleft Problems Bulletin, 2004 :Financial Humor Bulletin, 2011 :Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult :Political Skeptic Bulletin, 2011 :Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering :Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds :Larry Wall :John K. Ousterhout : CTSS : Multix OSUnix History : Unix shell history :VI editor :History of pipes concept :Solaris : MS DOS : Programming Languages History :PL/1 : Simula 67 :C :History of GCC development : Scripting Languages :Perl history :OS History : Mail :DNS : SSH : CPU Instruction Sets :SPARC systems 1987-2006 :Norton Commander :Norton Utilities :Norton Ghost :Frontpage history :Malware Defense History :GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 :The Mythical Man-Month : How to Solve It by George Polya :The Art of Computer Programming :The Elements of Programming Style :The Unix Hater’s Handbook :The Jargon file :The True Believer :Programming Pearls :The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society :Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story :The Cuckoo's Egg :IT Slang : C++ Humor : ARE YOU A BBS ADDICT? :The Perl Purity Test :Object oriented programmers of all nations : Financial Humor :Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor :Goldman Sachs related humor :Greenspan humor : C Humor :Scripting Humor :Real Programmers Humor :Web Humor : GPL-related Humor : OFM Humor :Politically Incorrect Humor :IDS Humor : 'Linux Sucks' Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor :Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor :Networking Humor :Shell Humor :Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 :Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor :Education Humor : IBM Humor : Assembler-related Humor :VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not LeastTechnology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D

Copyright © 1996-2020 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) in the author free time and without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

Teraterm Script Serial Port Angeles

FAIR USE NOTICEThis site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

Teraterm Macro Command

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree..

Teraterm Macro Examples

You can use PayPal to make a contribution, supporting development of this site and speed up access. In case softpanorama.org is down you can use the at softpanorama.info

Disclaimer:

Tera term serial port setup

Teraterm Script Serial Port Example

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with.We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last modified:March, 12, 2019