Versions Compared

Key

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

...

The Reset button is used to restart and reinitialize the modem. The message queue is not cleared with Reset button! Reset should be used in extreme cases: hang modem, sim-card after installation is not detected, registration in the home network ('registration denied') is forbidden.

SMS messages

To add a sms notification recipient, first open the window AddAdd Mailer SMS:

...

If these items do not fit your situation, try to restart the monitoring system. Also check the sending of messages from your mobile phone, making sure that the numbers of the sms-centers are the same.

SMS-commands

...

SMS commands are used for remote management by the monitoring system. Using these commands, you can read the status and measured values ​​of the sensors, and control the relay switches (sockets). The phone numbers from which the remote control will be made must be added to the list of allowed numbers in the modem parameters editing window (Main menu → System structure tree → GSM modem → Permitted numbers list). → Settings → List of allowed phone numbers).

Info
titleAttention!
To separate phone numbers, use a space. The number must start with "+".

In response to each sms command, an SMS response message arrives, in case of an erroneous command, sms with an error description and an example of the command comes. In one sms message there can be only one command for one element.

Sensor, relays (sockets) status reading commands

...

Syntax. get [idID] or get [name], where ID is the "ID" number of the element, "name" is the name of the element. The get field is not case sensitive, you can use Get, GET. The name field is case sensitive and can not contain blank characters.

Description. The command requests the status of the sensor or relay (sockets) and sends a response sms to the phone from which the command came, describing the status of the sensor.

Illustration.  

  • “get 1034” “get 201001” - get information about the sensor with the number 1034201001;

  • ”get Analog-1” - get information about the sensor with the name Analog-1;

  • "get 404001" - get information about the GSM Modem, in this case, the response message will only come if the modem is in the normal state, the response message show the signal level in the "value" field.

Response. In this case the response message looks like this: Onboard Temperature[201001] state=normal value=23.5 or GSM Modem[404001] state=normal value=80.

Commands for setting the status of the relay (sockets)

...

Syntax. set [idID] [state] or set [name] [state], where ID - the "ID" number of the element, "name" is the name of the element, "state" is the state to which you want to switch.  The set and state fields are not case sensitive. The name field is case sensitive. The state field takes one of the following states: on - enable, off - disable.

Description. The command will switch the relay or socket in accordance with the state parameter and send the reply sms to the phone from which the command came, about the result of the command.

Illustration.  

  • “set 1004 on” “set 302001 on” - turn on relay number 1004302001;

  • ”set Relay”set Outlet-1 on” - turn on relay RelayOutlet-1;

  • “set 1005 off” “set 302002 off” - turn off relay number 1005302002;
  • “set Relay“set Outlet-2 off” - turn off relay Relay-1Outlet-2.

Response. In this case the response message looks like this: The element was switched on or The element was switched off.

Relay (Socket) pulse setting commands

...

Syntax. set [idID]  pulse {duration} or set  set [name] pulse {duration}, where ID is the "ID" number of the element, "name" is the name of the element, duration is the delay time in seconds. The name field is case sensitive. The value range of the duration field is from 1 to 120. The duration field does not need to be specified, the previously set value is applied.

Description. The command switches the status of the relay (sockets) to the opposite one twice, with the time delay specified as the duration parameter in seconds.

Illustration.

  • “set 1004 pulse 15” “set 302003 pulse 15” - the impulse to the relay number 1004 302003 with a delay of 15 seconds;

  • “set Relay-1 pulse 110” - the impulse to the relay named Relay-1 with a delay of 110 seconds; 

  • "set Outlet-2 pulse" - sending a pulse to an outlet with the name Outlet-2 with a previously set delay

Response. In this case the response message looks like this: The element was switched.

Logic control commands (logic)

...

Syntaxlogic [id] [state] {duration},  logic * [state], where ID – the "Logic number" of the logic (the symbol '*' for all logics), state - the state into which the logic goes ("off", "on"), duration - the time of logic shutdown in seconds. All fields are case insensitive.

...

  • "logic 1 off 10" - disabling logic with the number 1 for 10 seconds;
  • "logic 1 on" - the inclusion of logic with the number 1;
  • "logic * off" - disabling all logs for 24 hours;
  • "logic * on" - including all logics.

Response. In this case the response message looks like this: OK.

Hot swappable sim card (Hot Swap)

...

Without disconnecting the system power, you can remove and after a while back insert the same or another sim-card. When you remove the sim card in the system log, the message "GSM Modem error: SIM not inserted" is displayed. If there is no sim card every 15 minutes, the modem automatically restarts, and the SMS message queue is saved.


Sending SMS using third-party programs

...

To send SMS, you can use, for example, the cURL utility. Either other programs with similar functionality.

To send SMS, use the following command in the console:

gcc -O2 -o sendsms sendsms.c

Script for sending SMS


#!/bin/bash
# SMS sending script for version 2.4.x and higher
 
usage()
{
cat << EOF
usage: $0 options
 
OPTIONS:
   -?,-h   Show this message
   -H      Hostname or IP address
   -u      User name
   -p      Password
   -P      Phone for sending
   -m      Message for sending
EOF
}
 
HOSTIP=
USERNAME=
PASSWORD=
TOPHONE=
MESSAGE='Test'
 
while getopts “hH:u:p:P:m:” OPTION
do
     case $OPTION in
         h)
             usage
             exit 1
             ;;
         H)
             HOSTIP=$OPTARG
             ;;
         u)
             USERNAME=$OPTARG
             ;;
         p)
             PASSWORD=$OPTARG
             ;;
         P)
             TOPHONE=$OPTARG
             ;;
         m)
             MESSAGE=$OPTARG
             ;;
         ?)
             usage
             exit
             ;;
     esac
done
 
if [[ -z $HOSTIP ]] || [[ -z $USERNAME ]] || [[ -z $PASSWORD ]] || [[ -z $TOPHONE ]] || [[ -z $MESSAGE ]]
then
     usage
     exit 1
fi
 
# 1) password hash
HASH=`echo -n ${PASSWORD} | openssl dgst -sha1 | awk '{print $NF}'`
 
# 2) authorization
RESPONSE=`curl -s -d "querytype=auth&name=${USERNAME}&h=${HASH}" "${HOSTIP}/engine.htm"`
 
# 3) session key
KEY=`echo -n  ${RESPONSE} | awk -F"\"" '{print $4}'`
 
# 4) send SMS
curl
 -d "querytype=send_sms_message&k=${KEY}" --data-urlencode
"to_phone=${TOPHONE}" --data-urlencode "message=${MESSAGE}"
${HOSTIP}/engine.htm > /dev/null 2>&1


In case of errors, leave comments below on the page or on our forum. Please indicate in the message the current version of the firmware of the monitoring system (System menu→About this system→Firmware version).