Introduction
GSM (Global System for Global Communications) is the communication system most widely used in mobile phones, and its first functionality is voice transmission. However, it also allows data transmission like SMS or Internet, at a very low speed.
GPRS (General Packet Radio Service) is an extension of GSM based on packet transmission that offers a more efficient service for data communications, especially in the case of Internet access.
In this post, you will learn how to send AT commands, specially how to send SMS from your Industrial GPRS Family of the open source PLC Raspberry Pi to your mobile phone, thanks to industrial automation.
Related links
Node-RED
In this post, we are going to develop a Node-RED flow to send SMS messages from the GSM module of the Raspberry Pi PLC controller to our mobile phone. The AT commands that we are going to use are the same as we used in this post.
First of all, check the following from your Raspberry Pi based PLC:Â
 SSH is enabled
  Node-RED is installed in your Raspberry Pi industrial PLC
 If you go to minicom using:
sudo minicom -D /dev/ttyS0 -b 115200
and type AT, you receive OK.
And once everything is ready, let's go with the Node-RED application!
Sending SMS

So the first thing that we are going to do is to add five inject nodes to set the msg.payload to the String messages like this:

msg.payload += Buffer.from("0D", "hex");
return msg;
Note that there is the symbol "+=" to append the \n after the AT commands.

Now, we have to add a Ctrl + Z character between the Hello message that we want to send, and the \n. The Ctrl + Z is represented by 1a in hexadecimal. So add the following to a function node and wire it between the inject node and the function node with \n.
msg.payload += Buffer.from("1a", "hex");
return msg;

Then, look for the serial out node and configure it as you want. We left the default values and configured the following:
Baudrate: 115200
Data Bits: 8
Parity: None
Stop Bits: 1
Add a serial in node wired to a debug node, where you will get the responses from the same port.

Finally, click on the buttons of the inject nodes, and see the results!


 Now, would you like to know how to work with a GPRS module?
Node-RED Tutorial: How to send AT commands with Raspberry PLC