Forward message from serial to sms

I am currently receiving messages from SMS and can forward these out of the serial port. I would now appreciate some help in writing a script that can work the other way around. I need to be able to listen on the serial port for a message and then forward this out via an SMS message. I can format the incoming serial message so that the phone number and message can be extracted. I need this to not interfere with the script that is receiving the SMS messages.

I’ve had a good hunt around but haven’t been able to find any guidance on this. I would really appreciate some help. Thanks in advanced.

Well this is looking like a non-starter. After more digging the only way I can see of capturing data from the serial port is to use /port remote-access. This only enables you to forward the data to over a TCP connection and optionally log it to a file.

I guess it’s possible to run a python script running inside a container to receive the data but then I don’t know how you would get a script to request this data and send it as a SMS message. Sounds convoluted and difficult.

You could log the data to a file and then read this file in a script to send as a SMS message but I can already see dragons ahead. Would probably run into problems with multiple processes accessing the same file. Sounds very fragile.

Does anyone have any ideas on how to receive serial data and use it inside a script?

Using a combination of /port remote-access, a container with custom python script and routeros scripting I think I can make it work. The problem is that containers are only supported on ARM(64) architectures. The LTE router I have is MIPS. I can’t find any LTE router that is ARM(64) architecture and has a serial console. Looks like another dead end.