Serial device commands and terminal login from Arduino

I am working on a device that will attach to the Terminal(serial) port of a Cisco router and draw power from the USB.

The goal is to have a 16x4 LCD displaying critical chassis environmental status in a bar graph format with LED's to indicate threshold breaches on any of the parameters.

The port requires login information to be sent to the router, as well as a handfull of commands on 5 sec intervals to refresh the data on the LCD.

An example set of commands:

Username Password

show cpu show mem show temp show sessions

I typically script this via *nix over SSH, AWK the data that I need, then echo the tabulated data to the CLI.

I have read numerous serial communication sketch examples and can't seem to track down any similar concepts.

Anyone doing this?

=Eric

The serial port will use RS232 so you'll need some extra circuitry to do the level shifting. Other than that, your use of the USB to draw power is irrelevant.

Do you now send the commands to and receive the data from the router over the serial connection?

If so it should be no problem to substitute an Arduino for your PC. It would be easier to develop the project on a Mega because it has 4 serial connections so you could connect Serial1 to the Router and use the Serial (the USB cable) for debug messages to the PC.

...R

KenF: The serial port will use RS232 so you'll need some extra circuitry to do the level shifting. Other than that, your use of the USB to draw power is irrelevant.

Thanks.

I currently use the MAX232 circuit to shift the signal for a bluetooth serial dongle I made to connect to the router. I can incorporate that same circuit if needed into this project.

Robin2: Do you now send the commands to and receive the data from the router over the serial connection?

If so it should be no problem to substitute an Arduino for your PC. It would be easier to develop the project on a Mega because it has 4 serial connections so you could connect Serial1 to the Router and use the Serial (the USB cable) for debug messages to the PC.

...R

Yes, I use putty via the serial port on my laptop to configure the router and log data/command history.

I have a batch of ATMEGA328P-PU's that I can purpose for this project. The additional serial pins will most definately come in handy.

My quandary is assembling the batch of commands to send repeatedly to keep the LCD populated with current pertinent information.

Anvilbrother: My quandary is assembling the batch of commands to send repeatedly to keep the LCD populated with current pertinent information.

Are these the 4 commands listed in your original post? If so I don't understand what is complicated.

And, just to be clear, the Atmega328 has only a single hardware serial USART - which is why I mentioned the Mega, which has 4.

...R