Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: typos

Table of Contents

Overview

The Serial Console and Serial Terminal are tools, used to communicate with devices and other systems that are interconnected via the serial port. The serial terminal may be used to monitor and configure many devices - including modems, network devices (including MikroTik routers), and any device that can be connected to a serial (asynchronous) port.

...

This cable does not utilize handshake pins at all:

Side1 (DB9f)Side2 (DB9f)Function
23

Rx ← Tx

32Tx → Rx
55GND

It allows data-only traffic on the cross-connected Rx/Tx lines. Hardware flow control is not possible with this type of cable. The only way to perform flow control is with software flow control using the XOFF and XON characters.

Null Modem With

...

Loopback Handshake

The problem with the first cable is when connected to a device on which hardware flow control is enabled software may hang when checking modem signal lines. 

Null modem cable with loop back handshake fixes the problem, its main purpose is to fool well-defined software into thinking there is handshaking available:

Side1 (DB9f)Side2 (DB9f)Function
23

Rx ← Tx

32Tx → Rx
55

GND

1+4+6-DTR → CD + DSR
-1+4+6DTR → CD + DSR
7+8-RTS → CTS
-7+8RTS → CTS

Hardware flow control is not possible with this cable. Also if remote software does not send its own ready signal to DTR output communication will hang.

...

This type of cable is not recommended for use with RouterOS.

Side1 (DB9f)Side2 (DB9f)Function
17+8

RTS2 → CTS2 + CD1

23Rx ← Tx
32

Tx → Rx

46DTR → DSR
55GND
64DSR ← DTR
7+81RTS1 → CTS1 + CD2

Null Modem With Full Handshake

Used with special software and should not be used with RouterOS.

Side1 (DB9f)Side2 (DB9f)Function
23Rx ← Tx
32

Tx → Rx

46DTR → DSR
55GND
64DSR ← DTR
78RTS → CTS
87CTS ← RTS

Null Modem Compatibility

Summary tables below will allow you to choose the proper cable for your application.


No handshake

Loopback
handshake

Partial
handshake

Full
handshake
RouterBoards
with limited port functionality
YYN*N
RouterBoards
with full functionality
YYYN

* - may work only when hardware flow control is disabled


No handshake

Loopback
handshake

Partial
handshake

Full
handshake
Software flow
control only
YY*Y**Y**
Low-speed DTE/DCE compatible
hardware flow control
NYY*N
High-speed DTE/DCE compatible
hardware flow control
NYY**N
High speed
communication
using special software
NNY*Y

* - will work as an alternative

...

This type of port is used on RouterBOARD 2011, 3011, 4011, CCR1072, CCR1036 r2, CCR2xxx and CRS series devices, sometimes called "Cisco style" serial port.

RJ45 to DB9 Cable Pinout:



SignalConsole Port (DTE)
RJ-45
RJ-45 Rolled Cable
RJ-45 Pin
Adapter DB-9 PinAdapter DB-25 PinSignal
RTS1885CTS
DTR2766DSR
TxD3623RxD
Ground4557Ground
Ground5457Ground
RxD6332TxD
DSR72420DTR
CTS8174RTS

RB M33G Additional Serial Header

For RBM33G additional serial header can be attached on GPIO pins U3_RXD, GND, U3_TXD, and 3V3

...

CCR Serial Header

The Cloud Core Router series devices have a serial header on the PCB board, called J402 or 100

Here is the pin-out of that connector:

Serial Console Usage

TODO:

Serial Terminal Usage

RouterOS allows to communicate with devices and other systems that are connected to the router via the serial port using a /system serial-terminal  command. All keyboard input will be forwarded to the serial port and all data from the port is output to the connected device.

...

Warning

Do not connect to devices at an incorrect speed and avoid dumping binary data.

Special Login

Special login can be used to access another device (like a switch, for example) that is connected through a serial cable by opening a telnet/ssh session that will get you directly on this device (without having to login to RouterOS first). 

For demonstration we will use two RouterBoards and one PC. 

Image Added

Routers R1 and R2 are connected with serial cable and PC is connected to R1 via ethernet. Lets say we want to access router R2 via serial cable from our PC. To do this you have to set up serial interface proxy on R1. It can be done by feature called special-login.

Info

By default console is bound to serial port. 

First task is to unbind console from serial simply by disabling entry in /system console menu:

Code Block
languageros
[admin@MikroTik] /system console> print
Flags: X - disabled, U - used, F - free
 #   PORT                                                                    TERM
 0 X serial0                                                                 vt102

Next step is to add new user, in this case serial, and bind it to the serial port

Code Block
languageros
[admin@MikroTik] > /user add name=serial group=full
[admin@MikroTik] > /special-login add user=serial port=serial0 disabled=no
[admin@MikroTik] > /special-login print
Flags: X - disabled
 #   USER                                                                    PORT
 0   serial                                                                  serial0

Now we are ready to access R2 from our PC.

Code Block
languageros
maris@bumba:/$ ssh serial@10.1.101.146

[Ctrl-A is the prefix key]
R2 4.0beta4
R2 Login:

[admin@R2] >

To exit special login mode press Ctrl+A and Q

Code Block
languageros
[admin@MikroTik] >
[Q - quit connection]      [B - send break]
[A - send Ctrl-A prefix]   [R - autoconfigure rate]


Connection to 10.1.101.146 closed.


Warning

After router reboot and serial cable attached router may stuck at Bootloader main menu

To fix this problem you need to allow access bootloader main menu from <any> key to <delete>:

  • enter bootloader menu
  • press 'k' for boot key options
  • press '2' to change key to <delete>
What do you want to configure?                                                   
d - boot delay                                                                
k - boot key                                                                  
s - serial console                                                            
n - silent boot                                                              
o - boot device                                                               
u - cpu mode                                                                 
f - cpu frequency                                                             
r - reset booter configuration                                                 
e - format nand                                                               
g - upgrade firmware                                                         
i - board info                                                                
p - boot protocol                                                            
b - booter options                                                            
t - call debug code                                                           
l - erase license                                                             
x - exit setup                         
your choice: k - boot key

Select key which will enter setup on boot:
 * 1 - any key
   2 - <Delete> key only

your choice: 2