Beginner: possible send/receive data through serial port?

Hi, it’s first time I’m trying to use routerboard scripts:
I would like to know if it’s possible excange data through serial port.
Example:
I have a PC connected to routerboard througn serial port: I need the routerboard sends 3 bytes to PC, then read the 3 bytes answer.
Is it possible?
Which commands have I to use?
Thanks.

Mikrotik’s Serial setup responds to standard AT commands.

http://en.wikibooks.org/wiki/Serial_Programming:Modems_and_AT_Commands#AT_Commands

I’m not sure which of these commands are (or are not) supported by (or necessary for) Mikrotik.

Ok, but if I have the At command “A” and I’m talking with a modem, how can I send the “A” command to modem without using keyboard?

… script?

I’ve not dealt with communicating with the Serial port before, but a script can execute just about any console command. See what commands you will use to send the comms using a Keyboard, and put it down in a script, and see what happens.

I’m going to start experimenting with it as well, because I want to attach a Duxbury GSM modem to a RouterBoard to send text messages as part of my netwatcher.

-K

Ok, I’ve found It’s possible connect to serial GPRS modem through System->Serial-terminal, but If I try to use the serial port (Serial0) I have a message the port is already in use: anyone can tell me why?

Serial0 usually is used as Serial Console. You need to disable it:

First you need to disable the serial console.

/system console print
Flags: X - disabled, U - used, F - free

PORT TERM

0 F serial0
/system console disable 0