Community discussions

MikroTik App
 
aarango
Member Candidate
Member Candidate
Topic Author
Posts: 158
Joined: Wed Nov 30, 2016 7:55 am

Connect MK - Linux laptop Serial

Thu Mar 30, 2017 4:00 pm

Hi,

Recently I bought this:
https://www.amazon.es/RS232-Serial-DB9- ... usb+serial

I connected to port serial and usb to my laptop, how could I get console? I tried using "Minicom" but not luck. Too I read manual but I hadnd't success

Thanks.
 
User avatar
null31
Member Candidate
Member Candidate
Posts: 183
Joined: Fri Dec 23, 2016 6:07 pm
Location: Brazil

Re: Connect MK - Linux laptop Serial

Thu Mar 30, 2017 9:29 pm

Hi.

Does appear some ttyUSB or ttyACM on /dev/tty*?
Also can be some ttySx.
This depend of serial controller from cable.

You can use the "screen" command to access the serial console.
A time ago, i used this tutorial to unbrick a tp-link router and i had success.
> http://blog.hajma.cz/2014/02/tp-link-tl ... cking.html
**From blog
Then I connected to the serial link:
$ screen /dev/ttyUSB1 115200,cs8,-parenb,-cstopb
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: Connect MK - Linux laptop Serial

Thu Mar 30, 2017 11:41 pm

Just to make sure, the MikroTik device you are trying to connect to has a serial port right? If not you can likely use the USB port on the MikroTik to connect another one of those USB adapters and then connect to the 2 serial adapters.

The settings are the same as what you'd use to connect to a Cisco device except the baud which is 115200 instead of 9600.

I've attached an image showing me serial consoling into my new hEX.

You may have to add a console on your MikroTik w/the /system console add port=<usb#> term=<name> command.
You do not have the required permissions to view the files attached to this post.
Last edited by idlemind on Fri Mar 31, 2017 1:17 am, edited 1 time in total.
 
DadoSa
just joined
Posts: 17
Joined: Thu Mar 16, 2017 4:16 pm

Re: Connect MK - Linux laptop Serial

Fri Mar 31, 2017 12:47 am

Hi,

Please check /var/log/syslog for adapter chipset and ttyUSBx.
If your chipset is Profilic it should work fine, but if you have something like
ch341-uart listed in syslog then you can try to compile driver for device

http://blog.xentoo.info/2015/12/31/ubun ... from-ebay/

I had ch341 adapter, but couldn't make it work.

Regards,
 
aarango
Member Candidate
Member Candidate
Topic Author
Posts: 158
Joined: Wed Nov 30, 2016 7:55 am

Re: Connect MK - Linux laptop Serial

Fri Mar 31, 2017 7:47 am

Hi,

Thanks you all. In dmesg I see /dev/ttyUSB0.

My router is this: https://routerboard.com/CCR1016-12G

Should I change any value on Minicom to connect router MK?

Thanks again.
 
DadoSa
just joined
Posts: 17
Joined: Thu Mar 16, 2017 4:16 pm

Re: Connect MK - Linux laptop Serial

Fri Mar 31, 2017 4:23 pm

Hello,

on ubuntu You can try:
sudo minicom
1. CTRL+A O
2. Serial port setup
3. Press A and modify /dev/ttyS0 (default value) to /dev/ttyUSB0, then press enter
4. Press E and set Bps/par/Bits to 9600 8/N/1
5. Under F and G set HW/SW flow control (if needed)

Save setup as dfl, exit and restart minicom

This should be regular setup, working fine with Cisco,...
 
kevintitus81
newbie
Posts: 33
Joined: Tue Mar 22, 2016 11:23 pm
Location: Austin,Tx
Contact:

Re: Connect MK - Linux laptop Serial

Sat Apr 01, 2017 3:45 am

In ubuntu I usually use "screen" to console in via serial. Usually it goes something like this...

user# sudo screen /dev/ttyUSB0 19200 <--(my particular usb to serial dongle) and then see if you get console.
 
aarango
Member Candidate
Member Candidate
Topic Author
Posts: 158
Joined: Wed Nov 30, 2016 7:55 am

Re: Connect MK - Linux laptop Serial

Wed Apr 05, 2017 11:57 am

Sorry for late reply. I tried with 9200, 115200... but when I connect -> minicom -o /dev/ttyUSB0 I can't see anything, screen is locked.

Have I enable any option on MK?

Thanks.
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: Connect MK - Linux laptop Serial

Wed Apr 05, 2017 4:57 pm

Hit enter at least 1 time to bring up login screen.

If it's not that then look at my previous post about configuring the MikroTik to use the /system console correctly. Does your model have a bit in serial port or are you doing a USB to Serial on the MikroTik as well as the computer like my picture?
 
DadoSa
just joined
Posts: 17
Joined: Thu Mar 16, 2017 4:16 pm

Re: Connect MK - Linux laptop Serial

Wed Apr 05, 2017 8:19 pm

What is output of lsusb?
 
aarango
Member Candidate
Member Candidate
Topic Author
Posts: 158
Joined: Wed Nov 30, 2016 7:55 am

Re: Connect MK - Linux laptop Serial

Thu Apr 06, 2017 9:10 am

Hit enter at least 1 time to bring up login screen.

If it's not that then look at my previous post about configuring the MikroTik to use the /system console correctly. Does your model have a bit in serial port or are you doing a USB to Serial on the MikroTik as well as the computer like my picture?
Sorry, not luck. I tried but I can't see any on screen. My router has a serial connection and other point is a USB. I connect serial to Router and USB to my laptop, after setup bps, and use:
#minicom -o /dev/ttyUSB0

My lsusb yes detect it:
#:~$ lsusb
Bus 001 Device 010: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter

Image

Thanks.
 
DadoSa
just joined
Posts: 17
Joined: Thu Mar 16, 2017 4:16 pm

Re: Connect MK - Linux laptop Serial

Thu Apr 06, 2017 10:13 am

As I wrote before, You have usb-to-serial adapter that is not working out of the box on linux.
You could try to compile driver, https://www.linux.org.ru/forum/linux-hardware/11965571,
for procedure look at the last post .

IMHO, best option for You is to sell current adapter and buy adapter based on PL23xx chipset,
adapters based on 340/341 chipsets are working fine under Windows.

Regards
 
aarango
Member Candidate
Member Candidate
Topic Author
Posts: 158
Joined: Wed Nov 30, 2016 7:55 am

Re: Connect MK - Linux laptop Serial

Thu Apr 06, 2017 12:10 pm

As I wrote before, You have usb-to-serial adapter that is not working out of the box on linux.
You could try to compile driver, https://www.linux.org.ru/forum/linux-hardware/11965571,
for procedure look at the last post .

IMHO, best option for You is to sell current adapter and buy adapter based on PL23xx chipset,
adapters based on 340/341 chipsets are working fine under Windows.

Regards
I just installed driver for usb-serial to Windows and Windows can identify the cable. Now I run putty, mark serial but I cant connect. What values should I use on putty? where should I connect?
I attach two pictures.

Thanks

Image

Image

Image
 
sid5632
Long time Member
Long time Member
Posts: 554
Joined: Fri Feb 17, 2017 6:05 pm

Re: Connect MK - Linux laptop Serial

Thu Apr 06, 2017 12:13 pm

Fairly obviously, COM8.
 
aarango
Member Candidate
Member Candidate
Topic Author
Posts: 158
Joined: Wed Nov 30, 2016 7:55 am

Re: Connect MK - Linux laptop Serial

Thu Apr 06, 2017 1:24 pm

Fairly obviously, COM8.
thanks, it was stupid for my side :)

I connected to COM8 but I can't see anything on screen, putty keep on blank screen (I setup 115200 bps)

Ayn idea?

Thanks.
 
DadoSa
just joined
Posts: 17
Joined: Thu Mar 16, 2017 4:16 pm

Re: Connect MK - Linux laptop Serial

Thu Apr 06, 2017 10:02 pm

If you reboot mikrotik box is there any startup messages?
Can you login via winbox, open terminal and check serial port config with

[admin@MikroTik] system serial-console> /port print detail
 
kevintitus81
newbie
Posts: 33
Joined: Tue Mar 22, 2016 11:23 pm
Location: Austin,Tx
Contact:

Re: Connect MK - Linux laptop Serial

Fri Apr 07, 2017 1:12 am

I would advise using "screen" if you are running linux, I have had issues with putty on serial connections in the past.

screen /dev/ttyUSB0 19200

then hit enter once and see if you get anything.

You may need to winbox to the device and check serial settings too.
 
aarango
Member Candidate
Member Candidate
Topic Author
Posts: 158
Joined: Wed Nov 30, 2016 7:55 am

Re: Connect MK - Linux laptop Serial

Fri Apr 07, 2017 9:00 am

If you reboot mikrotik box is there any startup messages?
Can you login via winbox, open terminal and check serial port config with

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

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

This is my output.
I tried it with screen but I don't receive anything.
Maybe I need a cable null modem between both sides?

Thanks.
 
DadoSa
just joined
Posts: 17
Joined: Thu Mar 16, 2017 4:16 pm

Re: Connect MK - Linux laptop Serial

Fri Apr 07, 2017 4:45 pm

Do you have any cisco box to try that adapter, maybe it's just not working?
Default settings are 9600 8N1
 
aarango
Member Candidate
Member Candidate
Topic Author
Posts: 158
Joined: Wed Nov 30, 2016 7:55 am

Re: Connect MK - Linux laptop Serial

Wed Apr 12, 2017 10:15 am

Do you have any cisco box to try that adapter, maybe it's just not working?
Default settings are 9600 8N1
Hi, thanks. I have requested a adapter, when I receive it I will test it.
 
aarango
Member Candidate
Member Candidate
Topic Author
Posts: 158
Joined: Wed Nov 30, 2016 7:55 am

Re: Connect MK - Linux laptop Serial

Mon Jun 26, 2017 12:51 pm

Hi, after some months without re-open post I have to say that I can't connect using serial.

My windows recognize the cable (COM4), and I have enabled serial0 and 1 in router MK but when I open putty with COM4 and baudios I can't connect.
[admin@MikroTik] /port> print
Flags: I - inactive 
 #   DEVICE NAME                                                                                                   CHANNELS USED-BY                                                                                                BAUD-RATE
 0          serial0                                                                                                       1 Serial Console                                                                                         115200   
 1          serial1                                                                                                       1 Serial Console                                                                                         115200
[admin@MikroTik] /system console> print
Flags: X - disabled, U - used, F - free 
 #   PORT                                                                                                                TERM                                                                                                               
 0 F serial0                                                                                                             vt102                                                                                                              
 1 F serial1                                                                                                             vt102
Why can't I connect to my router using COM port?

Thanks

Who is online

Users browsing this forum: Bing [Bot] and 63 guests