Sending text out over a serial port
Sometimes there's a need to send out some (short) text over a serial port to control other devices.
As RouterOS doesn't (yet?) provide a native command to do that, you can work around with the following little script:
/interface ppp-client add name="scripttemp" dial-on-demand=no port=serial0 modem-init="I am the string" null-modem=yes disabled=no :delay 1 /interface ppp-client remove [/interface ppp-client find name="scripttemp"]
The following assumptions were made:
- We want to use serial port "serial0"
- We have configured the serial port to match the other devices' setup (baud-rate etc.)
- serial0 (or whatever port you use) is not used by RouterOS serial-console
The script sends the text configured as modem-init string out over the serial port when run.
So in the example above, it would send "I am the string" (without the quotes).