3

I am trying to connect to the serial console of my MikroTik RB4011iGS+.

I might be missing something obvious, but I can't seem to get a terminal (or anything else).

Relevant documentation page:

https://wiki.mikrotik.com/wiki/Manual:System/Serial_Console

My current router configuration pertaining to /system console and /port:

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


[admin@MikroTik] > /system console print detail
Flags: X - disabled, U - used, F - free
 0 F port=serial0 channel=0 term="vt102"


[admin@MikroTik] > /port print
Flags: I - inactive
 #   DEVICE NAME                         CHANNELS USED-BY                       BAUD-RATE
 0          serial0                             1 Serial Console                115200
 1          serial1                             1                               115200


[admin@MikroTik] > /port print detail
Flags: I - inactive
 0   name="serial0" used-by="Serial Console" device="" channels=1 baud-rate=115200
     data-bits=8 parity=none stop-bits=1 flow-control=none

 1   name="serial1" used-by="" device="" channels=1 baud-rate=115200 data-bits=8
     parity=none stop-bits=1 flow-control=none

I have also tried working with 9600 baud and using the port serial1, with the same (lack of) results.

The RouterBoard is connected to my Linux machine running minicom 2.7, through the following cable connections:

  • The RouterBoard contains an RJ45 serial port on the back;
  • A straight RJ45 cable is connecting the RouterBoard to a Cisco-style adapter;
  • This Cisco-style adapter wires RJ45 to DB9, and I have double-checked with a multimeter that it is appropriately wired (see below);
  • Finally, the DB9 end is plugged to a Serial-to-USB cable.

This is the pinout of the Cisco-style adapter, as present on the corresponding MikroTik documentation page:

RJ45 to DB9 Cable Pinout

This is the Serial-to-USB kernel log and lsusb entry:

# dmesg
(...)
[632023.804776] usb 2-2: Product: USB-Serial Controller
[632023.804788] usb 2-2: Manufacturer: Prolific Technology Inc.
[632023.807327] pl2303 2-2:1.0: pl2303 converter detected
[632023.819548] usb 2-2: pl2303 converter now attached to ttyUSB0

# lsusb
(...)
Bus 001 Device 017: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
(...)

I literally grabbed an old 486 with Windows 95 to make sure the Serial-to-USB cable works fine, and I succeeded in communicating at 9600 baud between HyperTerminal/Win95 and Minicom/Linux using the Serial-to-USB converter and a null-modem cable.

Windows 95 running HyperTerminal, showing text sent from Minicom at Linux, proving the Serial-to-USB cable works fine.

I also tried to plug the Cisco-style adapter directly to the Win95 serial port. I wasn't able to get a terminal on HyperTerminal either.

I also tried to use picocom and later screen instead of minicom. None made any difference.

So, the problem shouldn't be in the adapter (it's wired fine, and I have two of them), nor the RJ45 cable (it does Ethernet just fine), nor the Serial-to-USB converter. However, I don't see anything else I can configure on the router (which I have also rebooted, and nothing showed up in the serial link - not even boot information). I followed all instructions from MikroTik, and even YouTube videos.

I'm now going slightly mad, knowing this is going to be some sort of stupid mistake. What can I possibly be doing wrong?

Thanks!

  • 1
    I know this is not going to be super helpful, but I've had RB2011's where the serial port just died. It's entirely possible that this could also happen on an RB4011. If your cable is working just fine elsewhere, and your config looks fine, that's what my money would be on. – Mark Henderson Aug 08 '19 at 04:03
  • @MarkHenderson I wasn't considering that possibility. This is a brand new device, and I am not used to making serial connections, so I find it more likely that I'm the one making some sort of configuration mistake. Nevertheless, I contacted the store I bought this at, and am now waiting for an answer. I didn't mention this on the question, but it should be obvious by now - I ensured the settings are the same on both sides, either 115200 8N1 or 9600 8N1, and I also tried 7E2 because why not? – Valmiky Arquissandas Aug 08 '19 at 12:30

2 Answers2

2

So, I knew this was going to be a stupid (and embarrassing) mistake. I'm just sad it took a failed RMA in the meantime.

TL;DR: the adapter's pins are inverted (rolled?), and I systematically tested it upside-down, probably assuming I was supposed to match the male pins instead of the female, so everything looked alright. A straight RJ45 cable was not appropriate. I needed a rolled RJ45 cable.

How long did it take me to find out? It's story time, hopefully to help someone else in the future:

I contacted the store, showed them this post, and they also concluded that it may be a malfunction, and created an RMA. I sent the RouterBoard over, and waited.

The next day, the store contacted me indicating that everything was working fine, and no anomaly was detected, so it was clear something was wrong on my side. Keep in mind, this is the first time I'm doing RS-232 over RJ45.

I received the router today, tried again, and the problem obviously remained.

Finally, I decided to do the obvious thing, and made my own adapter, since that was the only part I never had a chance to test (and never really used) before. Perhaps my adapters had a bad contact or something? Thankfully, I have a cable stripper, and I still hadn't soldered my gigatron.io, whose Pluggy McPlugface PS/2 adapter has a female DB-9 connector that I can use.

So, I stripped an RJ45 cable on one side, and wired the adapter on a breadboard (previous Cisco adapter also pictured):

RJ45-DB9 adapter wired on breadboard

And it worked immediately, on the first attempt, right from the RouterBoard boot.

Serial console working

Only after reaching this point did I notice that I had the RJ45 contacts reversed to the ones in the adapter.

The Cisco adapter is inverted (rolled?). I looked it up and found out it's a thing.

So, a straight RJ45 cable is not appropriate. A rolled RJ45 cable was required, and I will be using the rest of the cable I stripped to make one up.

That's it. Probably the kind of situation where a second pair of eyes would have spotted the mistake far sooner.

Thank you for your attention, and you may now collectively groan!

1

I use screen- with THIS serial cable which works with both OSX & Linux - to connect to my router's RB4011 router's serial port.

The syntax of the screen command your require is:

sudo screen /dev/(serialDevice) (baudRate) (TransmissionRate) (flowControl)

To connect to my RB4011iGS+5HacQ2HnD-IN router, the screen command I use is:

sudo screen /dev/ttyUSB0 115200 cs8 ixoff

"cs8" being the bit rate of router and "ixoff" specifying "No Flow Control". "115200" is the baud rate of router.

Note that device"ttyUSB0" is specific to the serial cable I'm using. But the rest of the command you can use as specified.

All the "HowTo's" for using screen to make a serial connection I've found on the 'net only tell you to pass just the baud rate to the command, but this is insufficient when I tried it. Without additionally passing the *Transmission Rate and Flow Control to screen, the command will just hang when you try to connect to the RB4011.

My serial config on the RB4011 is as follows:

[admin@RB4011] > /port print 
Flags: I - inactive

 #   DEVICE NAME       CHANNELS USED-BY     BAUD-RATE

 0     serial0         1 Serial Console        auto

 1     serial1         1                      115200

.

[admin@RB4011] > /system console print

Flags: X - disabled, U - used, F - free

 #   PORT              TERM

 0 F serial0           vt102

I've also successfully used minicom -s to make a serial connection to the router. However, as minicom makes you go through setup menus to configure the connection, I prefer screen which lets you just pass all the required parameters directly to the command.

F1Linux
  • 335
  • 5
  • 12