Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:sw:01-mervis:sending-sms-lte-hidden [2021/07/09 07:29]
avsetula
en:sw:01-mervis:sending-sms-lte-hidden [2022/11/02 12:26] (current)
avsetula [Receiving/sending SMS]
Line 1: Line 1:
-====== ​Sending ​SMS ======+<​html><​div class="​version-switch">​ 
 +  <a href="#​sending_sms"><​div class="​actual-version">​Patron / Axon LTE</​div></​a>​ 
 +  <a href="/​en:​sw:​01-mervis:​sending-sms-hidden"><​div>​Neuron GSM</​div></​a>​ 
 +</​div></​html>​ 
 + 
 +====== Receiving/​sending ​SMS ======
 <WRAP group> <WRAP group>
 <WRAP half column 81%> <WRAP half column 81%>
-[[https://​www.unipi.technology/​unipi-patron-s167-lte-p383|Some of our PLCs]] are equipped with LTE modem capable of sending SMS. In this tutorial we will learn how to configure such PLC and how to use function block for sending SMS.+/*[[https://​www.unipi.technology/​unipi-patron-s167-lte-p383|*/ Some of our PLCs /*]]*/ are equipped with LTE modem capable of sending SMS. In this tutorial we will learn how to configure such PLC and how to use function block for sending SMS.
 </​WRAP>​ </​WRAP>​
 <WRAP half column 15%> <WRAP half column 15%>
Line 12: Line 17:
 </​WRAP>​ </​WRAP>​
  
-For sending SMS over LTE modem, ​you don't need to configure the modem as described in [[lte-configuration-hidden|]]. Instead, you need to configure **Alarm channel**. Double click on the **PLC** in the **Left panel**. Select a **Messaging** subpanel, right click on the blank list of channels and select **Add alarm channel** from the context menu:+ 
 +===== Modem configuration ===== 
 +For receiving/sending SMS via an LTE modem, ​it is not necessary ​to configure the modem as described in [[lte-configuration-hidden|]]. Instead, you need to configure **Alarm channel**. Double click on the **PLC** in the **Left panel**. Select a **Messaging** subpanel, right click on the blank list of channels and select **Add alarm channel** from the context menu:
  
 {{:​en:​sw:​01-mervis:​sending-sms-01-add-alarm-channel.png?​direct|}} {{:​en:​sw:​01-mervis:​sending-sms-01-add-alarm-channel.png?​direct|}}
 +
 +----
  
 A new alarm channel will appear. By default it is filled with preconfiguration for sending emails. Click on the **Type** (now prefilled with "​Smtp"​) and change it to **Gsm**: A new alarm channel will appear. By default it is filled with preconfiguration for sending emails. Click on the **Type** (now prefilled with "​Smtp"​) and change it to **Gsm**:
  
 {{:​en:​sw:​01-mervis:​sending-sms-01-type-gsm.png?​direct|}} {{:​en:​sw:​01-mervis:​sending-sms-01-type-gsm.png?​direct|}}
 +
 +----
  
 Move over to the channel'​s properties and change the **Port Number** to **LTE**: Move over to the channel'​s properties and change the **Port Number** to **LTE**:
  
 {{:​en:​sw:​01-mervis:​sending-sms-03-port.png?​direct|}} {{:​en:​sw:​01-mervis:​sending-sms-03-port.png?​direct|}}
 +
 +----
  
 If the SIM card is protected with a PIN code, enter it, otherwise leave empty: If the SIM card is protected with a PIN code, enter it, otherwise leave empty:
  
 {{:​en:​sw:​01-mervis:​sending-sms-04-pin.png?​direct|}} {{:​en:​sw:​01-mervis:​sending-sms-04-pin.png?​direct|}}
 +
 +----
  
 Most modems (UniPi'​s as well) need initialization commands. Click to three-dot icon next to **AT Commands Definition**. A window will pop up: Most modems (UniPi'​s as well) need initialization commands. Click to three-dot icon next to **AT Commands Definition**. A window will pop up:
  
 {{:​en:​sw:​01-mervis:​sending-sms-05-at-commands.png?​direct|}} {{:​en:​sw:​01-mervis:​sending-sms-05-at-commands.png?​direct|}}
 +
 +----
  
 In the drop down menu select the correct modem. For UniPi Axon product line it is **UniPi Axon LTE**: In the drop down menu select the correct modem. For UniPi Axon product line it is **UniPi Axon LTE**:
  
 {{:​en:​sw:​01-mervis:​sending-sms-06-lte.png?​direct|}} {{:​en:​sw:​01-mervis:​sending-sms-06-lte.png?​direct|}}
 +
 +----
  
 Don't forget to apply this selection by clicking on **Apply** and closing this dialog: Don't forget to apply this selection by clicking on **Apply** and closing this dialog:
  
 {{:​en:​sw:​01-mervis:​sending-sms-07-apply-confirm.png?​direct|}} {{:​en:​sw:​01-mervis:​sending-sms-07-apply-confirm.png?​direct|}}
 +
 +----
  
 The channel is configured and now the changes need to be commited. Click on the **OK** in the red bar: The channel is configured and now the changes need to be commited. Click on the **OK** in the red bar:
Line 44: Line 65:
 {{:​en:​sw:​01-mervis:​sending-sms-08-commit.png?​direct|}} {{:​en:​sw:​01-mervis:​sending-sms-08-commit.png?​direct|}}
  
-To use the modem in program, look for "​**SendSMS Triggered**"​ function block and place it into a program: 
- 
-{{:​en:​sw:​01-mervis:​sending-sms-09-place-sendsmstrig.png?​direct|}} 
- 
-The function block expects 4 inputs and we will create a auxiliary variables for better debugging. Starting with the variable for input **channel**. Create a **string** variable and set its initial value to the name of the created alarm channel. By default it will be **alrchannel**:​ 
- 
-{{:​en:​sw:​01-mervis:​sending-sms-10-channel-variable.png?​direct|}} 
-** 
-The same we will do for the rest of the variables:​** 
- 
-  * **recipient:​** string variable containing a phone number in international format such as 00420777666555) 
-  * **message:​** string variable containing the actual SMS message 
-  * **trigger:​** bool variable which will execute the sending of the message on **rising edge** 
- 
-The result should look similar: 
- 
-{{:​en:​sw:​01-mervis:​sending-sms-11-all-variables.png?​direct|}} 
  
-Now deploy the solution and start the debugging mode. On each change of the variable ​**trigger** from **False** to **True**, the message will be send:+====== ====== 
 +/Odeslání SMS *
 +{{page>​en:​sw:​01-mervis:​send-sms-hidden}}
  
-{{:​en:​sw:​01-mervis:​sending-sms-12-debugging.png?​direct|}} 
  
-If the SMS has been send correctly, the **Result** output will be **0**. Otherwise an error code will be issued and you can consult help (F1) for the given function block to determine the cause of the error.+====== ====== 
 +/* Příjem ​SMS *
 +{{page>​en:​sw:​01-mervis:​receive-sms-hidden}}