Jump to content

Get Text from Hyperterm or com port


glr10
 Share

Recommended Posts

I haven't written a basic program since my Trash-80 died and when VB and C came on board I didn't have time to learn a new language. Anyway now I am trying to do a simple project using Autoit to change the config file on the Livingston and Cisco routers. I wrote a very newbie script using a sleep() between each command because I could not figure out how to get the routers response from the Hyperterm window. When I used the WinGetText it returns the time from the Hyperterm frame and does not get the test from the window inside the frame. I read a lot of posts on this forum and a few on getting from the com port but the main one required VB. I don't have VB on my pc. I would like to read it from within Hyperterm but then again I want the last few words sent from the router.

Thanks - I'd appreciate any guidance

Link to comment
Share on other sites

I use to work with switches everyday (Extreme Networks not Cisco but the point is the same) and I found Hyperterm to be kinda difficult to use so I went for an amazing free software which is TeraTerm - download link

It has a big advantage over Telnet: it can be used for serial links (COM1) which is very useful when configuring switches on site.

Download, install and give it a try - if you like it, I will be able to help you. What I've managed to do is a very complex script able to handle every type of switch built by Extreme, no matter the operating system used and the command synthax. The script is logging into the switch, running some commands for extracting important info (switch type, firmware, bootrom, operating system) and sets variables according to what it finds. The script is able to update firmware, bootrom, generate SSH keys, manage accounts, manage SNMP, configure the switch (VLANs, spanning tree,banners, RADIUS ... all the stuff).

The key here is to use the log ability of Tera Term and to read the log file abfer you sent a command - that will return the switch answer to your command:

ex: first you send a @CR in order to get the first line in the log file -> read the log and find that the answer is "login" -> send "admin" -> read the log again and the answer is "password" -> send the password -> read the log again and ... if the switch returns "something ... #" then you're in, but if the switch returns "login failed" you know that something went wrong .... and so on ...

Is a tremenduous work to make such a script but is entirely possible. Mine is working very well and I'm still adding features (working on it for the last 6 months).

As I said - try TeraTerm and I might be able to help (however the biggest part of the work will be done by yourself - I will give you everytime the guidelines and help with the code as much as I can).

Good luck,

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

Thanks - I will give TeraTerm a try. I am not looking for anything quite so complex. I mainly want to switch who it tells the modem to call but I have to erase the config and put it back in. Lucent routers you almost have to type it all in. I thought I'd try to automate it a little.

Thanks

Edited by glr10
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...