question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

device_type: cisco_ios_serial error using USB mini-Type B

See original GitHub issue

Hello @ktbyers

In some models of Cisco devices, you can find a USB mini-Type B console port on the front of the device which lets you connect serially to that device. When I am connected to a Cisco device using that Type B console cable and trying to initiate a serial connection instance, I get an error. But when I use a standard Cisco console cable (RJ-45), it works like a charm. I don’t know what is the problem with the Type B cable?

I know the two cables work with different technologies. But what is the issue in this case?

The error I get:

$ python serial_conn.py
Timed-out reading channel, pattern not found in output: terminal\ length\ 0

Router prompt not found: 'switch_'

Code sample:

#!usr/bin/env python3

from netmiko import ConnectHandler as CH
from pprint import pprint

# Define a device
device = {
    "device_type": "cisco_ios_serial",
    "ip": "10.1.1.1",
    "username": "cisco",
    "password": "cisco",
    "serial_settings": {
        "port": "COM4",
    },
}

# Initiate a serial connection instance to device
with CH(**device) as net_connect:
    output = net_connect.send_command("show version", use_textfsm=True)
pprint(output)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ktbyerscommented, Jun 29, 2021

cisco_ios overwrites the default and sets it to True (in its class).

https://github.com/ktbyers/netmiko/blob/v3.4.0/netmiko/cisco/cisco_ios.py#L15

Note, I just changed some of this behavior in the Netmiko develop branch, but this is True for Netmiko version 3.4.0 which is what is released on pypy (and version 3.4.0 is also what I linked to above).

0reactions
Tes3awycommented, Jun 29, 2021

I tried using send_command_timing("show version", use_textfsm=True) instead and it worked. But there is something I noticed which is weird to me. I also had to explicitly set "fast_cli": False!!. Without "fast_cli": False, I got the same error. However; I can see in the BaseConnection class that fast_cli has False as its default value. (I am using Netmiko v3.4.0)

Screenshot 2021-06-29 195832

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mini-USB console port problem - Cisco Learning Network
I've downloaded and installed the driver for the Mini-USB console connection on many switches. TeraTerm sees the new COM3, but then it says...
Read more >
USB Connector and Cable Type Guide - Newnex
Different from previously mentioned USB A type and B type connector, USB C Type connector can be used on both host controller ports...
Read more >
What Is USB? USB, Micro and Mini USB | Connector Guide
The B-style connector is designed for use on USB peripheral devices. The B-style interface is squarish in shape, and has slightly beveled corners...
Read more >
Amazon Basics USB 2.0 Cable - A-Male to Mini-B Cord - 6 ...
Amazon.com: Amazon Basics USB 2.0 Cable - A-Male to Mini-B Cord - 6 Feet (1.8 Meters)Black- 1-Pack : Electronics.
Read more >
Pearstone USB 2.0 Type A Male to Type B Mini Male Cable
It features a type A male connector on one end and a mini type B male on the other end. Braided copper shielding...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found