Community discussions

MikroTik App
 
lwq
just joined
Topic Author
Posts: 21
Joined: Mon Mar 19, 2012 10:53 am

Serial-terminal output read from script

Mon Mar 19, 2012 11:10 am

Hi there,

Is there any possibility to read output of RS232 attached device from script ? Maybe serial-terminal ? But how to read it in script ?

Attached device sends every x seconds plain text to RS232 and output of serial terminal is:

/system serial-terminal 0
3452;8457
(x seconds)
2854;4788
...

And I need to read these semicolon separated data - a RS232 output ...

I've tried almost everything I think ... :lol:

Thanks a lot ! 8)
 
User avatar
joshaven
Member
Member
Posts: 438
Joined: Fri May 06, 2011 1:50 am
Location: USA
Contact:

Re: Serial-terminal output read from script

Mon Mar 19, 2012 7:28 pm

Have you gone to "/system ports" and setup the a new remote port? This will allow you to remotely access something attached to the serial port. Note, the serial port has to not be in use for system management to use the remote port feature.

Check this out for more info:
http://wiki.mikrotik.com/wiki/Serial_Po ... n_RouterOS
 
lwq
just joined
Topic Author
Posts: 21
Joined: Mon Mar 19, 2012 10:53 am

Re: Serial-terminal output read from script

Wed Mar 21, 2012 2:04 pm

Have you gone to "/system ports" and setup the a new remote port? This will allow you to remotely access something attached to the serial port. Note, the serial port has to not be in use for system management to use the remote port feature.

Check this out for more info:
http://wiki.mikrotik.com/wiki/Serial_Po ... n_RouterOS

Yes, I've tried this. Even I have made special-login user to talk with serial device directly. But this does not work for me. I need to make set of two devices RouterBoard + RS232 device and these set will send RS232 device provided data (fetch tool) to remote server even when RB is behind NAT or with dynamic address. That is because I need to read data from serial-terminal ...

Thanks ... 8)
 
fe4r
newbie
Posts: 34
Joined: Mon Feb 25, 2008 7:02 pm

Re: Serial-terminal output read from script

Fri Mar 30, 2012 10:26 pm

I need do the same, some result?
 
lwq
just joined
Topic Author
Posts: 21
Joined: Mon Mar 19, 2012 10:53 am

Re: Serial-terminal output read from script

Wed Apr 04, 2012 12:48 am

I need do the same, some result?
Well, I've found this ugly solution which works for me, but it may not for you.
It is based on /port remote-access which allows to log serial console ...

/port remote-access add allowed-addresses=0.0.0.0/0 channel=0 disabled="no" log-file="tm.dat" port="serial0" protocol="raw" tcp-port=0

... this will make /file tm.dat which will log console output (therefore you'll need to manage its delete and recreate ...) ...

Something about it (in czech (use google to translate/or ask me)) is at http://www.papouch.com/cz/shop/product/ ... -mikrotik/

Hope it will help you 8)
 
fe4r
newbie
Posts: 34
Joined: Mon Feb 25, 2008 7:02 pm

Re: Serial-terminal output read from script

Wed Apr 04, 2012 6:09 pm

I need do the same, some result?
Well, I've found this ugly solution which works for me, but it may not for you.
It is based on /port remote-access which allows to log serial console ...

/port remote-access add allowed-addresses=0.0.0.0/0 channel=0 disabled="no" log-file="tm.dat" port="serial0" protocol="raw" tcp-port=0

... this will make /file tm.dat which will log console output (therefore you'll need to manage its delete and recreate ...) ...

Something about it (in czech (use google to translate/or ask me)) is at http://www.papouch.com/cz/shop/product/ ... -mikrotik/

Hope it will help you 8)

great! i think it will help me! thank you!

just for your knowledge, i wanna do a power loss warning. Like something that will notice by the serial port when the power is loss.
But I think, i will have to do some serial controller to send any information (can be just a bit) to the mikrotik serial, mikrotik reads it them do some other thing to notice the NOC.
 
lwq
just joined
Topic Author
Posts: 21
Joined: Mon Mar 19, 2012 10:53 am

Re: Serial-terminal output read from script

Wed Apr 04, 2012 9:10 pm

But you will need to send alarm via serial am I right ?

Our solution to alarm 230V blackout is based on 230V relay to connect to GIOM 300 with GSM module and so on ... 8)

http://www.mikrovlny.cz/en/product/32

http://www.mikrovlny.cz/en/produkt/27
 
lwq
just joined
Topic Author
Posts: 21
Joined: Mon Mar 19, 2012 10:53 am

Re: Serial-terminal output read from script

Thu May 10, 2012 2:27 pm

Solution revealed ...
More on http://www.papouch.com/en/shop/product/ ... -mikrotik/

8) coool ...

Who is online

Users browsing this forum: No registered users and 25 guests