Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

GSM modem is used to send sms-notifications and to receive sms-modem is used to send notifications and to receive SMS commands.

Configuring GSM modem

Before GSM modem can a GSM modem can be used, you have to fill in the in the fields in the GSM modem properties window.  Go to to "GSM Modem" → "Edit" → "Edit GSM modem":

  • Name – the  – the name of GSM modemthe GSM modem, "GSM Modem" by default; 

  • PIN – PIN code of SIM card.  This field can be empty if the PIN code is deactivated on the SIM card; 

  • SMS Center – the number of the SMS centrecenter.   At connection, the number is read from the SIM card.  After editing the changes are saved on the SIM card;

  • Allowed numbers – the list of numbers that are allowed to send SMS commands.  SMS commands from any other number will not be executed. The number must begin with a "+".

Fields describing the status of the GSM modem:

  • IMEI – unique  – a unique number that identifies the GSM modem;

  • State – the state of GSM modem;

    • not connected – GSM modem is not connected;

    • low – GSM modem is initiating or  disconnecting; 

    • normal – GSM modem is ready to send SMS;

    • warning – occurence occurrence of a one-time error time error that does not affect the overall operation of the the overall operation of the GSM modem;

    • alarm – occurence occurrence of error that does not allow further operation of GSM modem.

  • Network status – network status:

    • registered in Operator – registered in network  Operator;

    • registered – registered in the network;

    • not registered – not registered in-home network;

    • registration denied – registration in the home network is denied.

  • GSM status – general status of GSM modem:

    • not found – GSM modem is not found; 

    • found, not ready – GSM modem is found but is not ready for operation;

    • found, ready – GSM modem is found and is ready for operation.  In addition, this field shows errors that occur during the operation of the GSM modem e.g.error sending SMS.

...

To save the settings press "Save".  In order to To avoid repeating the procedure every time you connect the monitoring system, the settings should be saved in the flash memory of the system.  Go to " System menu" → "Save settings to flash".

SMS notifications

...

Info

...

For more information on creating SMS see

...

the section Setting up GSM modem (v2.0.1 - v2.2.5).

To add a recipient of SMS notification go to "Add"→"Add Mailer SMS":

  • Name – Name – name of notification.  Can be random ( name, recipients recipient position, etc.), "SMS" by default;

  • Phone number – the recipients number – the recipient's phone number.  The number must begin with a  "+". 

  • Message – Message – the text of the message, can be in any language.  The length of the message which contains latin Latin characters is a max 160, cyrillic and Cyrillic characters - are 70.  If the length of the message exceeds this limit the SMS is split into several parts.  In addition, this field allows you to edit macros (1%-7%) which insert the real values of the variables instead of the text. 

To send a test message press "Send sms".  The macros in   The macros in the message text will text will be displayed in its original form (% in its original form (% ..). To save the notification  To save the notification properties, click "Save". 

After filling in the properties of notification , you must specify the specify the event, at occurence the occurrence of which SMS notification   will will be sent. To  To do this, go  go to "Preferences" → "Logic schemes"→ "Add" and specify the conditions for sending SMS  and specify the conditions for sending SMS notifications. 

For each new recipient, you have to repeat the procedure of adding SMS notification.   

Before messages are sent they are queued up,  which means you do not have to wait until the previous message is sent.  The information on all SMS sent is displayed in the log of the monitoring system.

If an error occurs while sending a messageoccurs while sending a message, the log displays "SMS send error" and indicates the and indicates the error number.  The most common error is 515   The most common error is 515 (Ps busy), which  which can occur when:

  • not enough credit on the SIM card; 

  • wrong SMS centre center number;

  • low signal level ( less than 15%) in the home network;

  • wrong SMS format ( the number must begin with a "+") or the number is invalid.

If these points do not cover your case, try to reboot the system.  In addition, try to send an SMS from your mobile phone, make sure the SMS centre center number is the same.

SMS commands

SMS - commands are used for remote control of used for remote control of the monitoring system. Using  Using these commands, you  you can read the state and the measured values of sensors, control  relays or outletsPhone numbers from which the the state and the measured values of sensors, control relays, or outlets. Phone numbers from which the SMS commands will be sent , should be added be added to the list of allowed numbers in the modem properties list of allowed numbers in the modem properties ( Right click on the modem icon "Edit GSM modem" → "Allowed numbers").  In response to each SMS-  In response to each SMS command,  a response SMS response SMS will be sent.  In   In case of an of an error, an SMS will be sent with information about the error and an example of of a command. An  An SMS can contain only one command for only one element.

Command: reading sensor (relay, outlet) parameters

Function. get [id] or get [name], where id – is the number of the element, name –  and name – is the name of the element. Field The field "get" is not case sensitive, both can be used Get, GET.  Field The field "name" is case-sensitive.

Description.  This command checks the state of the sensor or relay (outlet) and sends a response SMS to the phone, from which the command was sent.

Examples.

  • “get 1034” - to obtain information about the sensor with number 1034 to obtain information about the sensor with the number 1034;

  • ”Get Analog-1” - to obtain information about the state of the element with the name of Analog to obtain information about the state of the element with the name of Analog-1;

  • “GET Relay-2” - to obtain information about  to obtain information about the state of the element with the name of Relayof the element with the name of Relay-2.
      
    See the section "Macros in the notification text" in 71404793Setting up GSM modem (v2.0.1 - v2.2.5) for further information.

Command: setting state of relay/outlet

  Function. set [id] [state] or set [name] [state], where id – number of the element, name – name of the element, state – state to which relay/outlet switches. Field Fields "set" and "state" are not case-sensitive. Field The field "name" is case-sensitive.  Field "state" can be in the following states:  on – switch on, off – switch off.

 Description. This command switches the relay ( outlet) in accordance with the state parameter. In response, it sends an sms notification to the phone number, from which the command was received,  with the result of the command.

 Examples.

  • “set 1004 on” - switch on relay with number 1004;

  • ”Set Relay-1 on” - switch on a relay with the name Relay-1;

  • “SET Relay-2 Off” - switch off the relay with the name Relay-1;

  • “set 1005 OFF” - switch off the relay with the number 1005.

Command: setting impulse of relay/outlet

 Function. set [id] [name] pulse [duration], where id – number of the element, name – name of the element, duration – duration of delay in seconds. Field  The field "name" is case-sensitive.  The range of values for the field "duration" is from 1 to 120.  

...

  • “set 1004 pulse 15” - pulse is sent to the relay with number 1004 with a delay time of 15 sec;

  • “SET Relay-1 PULSE 110” - pulse is sent to the delay with name Relay-1 with a delay of 110 sec;

  • “set Relay-2 pulse 10” - pulse is sent to the relay with the name Relay-2 with a delay of 10 sec.

For errors related to the GSM modem, leave comments on this page.  Please indicate the firmware version of your monitoring system ( "System menu" → "About this system" → "Firmware version"). 

Sending SMS from PC

You can use an external program to send SMS directly from your PC.  An example of such a program and an example of code in C can be found here:

...

The zip file Adobe AIR contains the application and an example of code in C.  To follow the example please use the following command in the console:

Code Block
gcc -O2 -o sendsms sendsms.c

To send SMS you can use a free software such as cURL:

Script example of sending SMS

#!/bin/bash

 

HOST=<IP or hostname EMS with GSM-modem, for example: http://telemetry.asia>

PASS='<your password>'

PLUS='%2B'

TOPHONE=''$PLUS'<your phone, for example: 421908xxxxxx>'

MESSAGE='<your message>'

 

curl -d 'epassword='$PASS'&querytype=send_sms_message&to_phone='$TOPHONE'&message='$MESSAGE'' $HOST/engine.htm

developer notes: linkchange

...