cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
676
Views
0
Helpful
2
Replies

Cisco 5915 Prompt Question Problem

embeddedman
Level 1
Level 1

Hi,

I'm using Cisco 5915 (C5915-ENTBASE-M, v.15.6) over serial port with a linux machine. I am in trouble in terminal while answering router questions with an application which uses serial port.

When I want to pass into EXEC mode over serial terminal via SSH:

router>enable (press enter)

Password: 1234 (press enter)

router#

This is OK.

 

But when I wanted to do this with an application using serial port in canonical mode:

read()=> "router>"

write("enable\r");

***Here it is waiting about 30 sec***

read()=> "Password:"

read()=> "% Password: timeout expired"

 

So, I can not catch "Password:" prompt in time. I think, when router wants to ask a question, it does not send a carriage return. That means read block does not include a carriage return and I can not read serial port because of usage of serial port in canonical mode. Also, I configured serial port for '\r' character beside of '\n'.

Do you have any idea about this issue ?

 

2 Replies 2

CEE95
Level 1
Level 1

Hello embeddedman.  Can you provide more information on the configuration on the serial connection?

Hi CEE95,

Basic configuration is 

c_lflag = ICANON;

c_oflag = OPOST;

c_iflag = ICRNL;

memset(c_cc, 0, NCSS);

c_cc[VEOL] = '\r';

 

But I think, problem is CISCO does not send any EOL character. So, I can not catch anything while it prompting a question. I guess, I need to use serial port in incanonical mode ?

 

Review Cisco Networking for a $25 gift card