Versions Compared

Key

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

...

The list of operators is updated once a few minutes after the system is turned on. Next time the list can be updated by the button. Getting the list is a long procedure and can take several minutes. When successfully receiving the list the corresponding message is displayed in the log.

If it is not possible to setup set up the connection with the network of the selected operator, then the modem switches to the automatic selection mode.

The name of the operator on the network of which that works the modem is showing shown in the Operator field.

GSM modem elements

The “System Tree” menu has elements corresponding to the status of the modem. These elements do not affect the state of the element "System". Elements can be used in logical schemes.

...

  • GSM Signal Level - analog value, shows the signal level in percent from 0 to 100%;

  • GSM State - discrete value, shows the state of the GSM network:

    • Not connected - if the connection has not yet been established;

    • Alarm - if an error has occurred;

    • Normal - if the connection is established successfulysuccessfully.

  • LTE State - discrete value, shows the state of the LTE connection if the modem support supports it:

    • Not connected - if the connection has not yet been established or disabled;

    • Alarm - if an error has occurred;

    • Normal - if the connection is established successfulysuccessfully.

SMS messages

To add an SMS notification recipient, first, open the System Tree menu, further open the window →SMS:

  • Name – name of the notification. Can be arbitrary (name, the position of the recipient, ...);

  • Phone number – the telephone number to which the notification has to be sent.  

  • Message text – text message messages can be in any language. Also in this field, you can use various macros (%1 - %8), which insert the current values of variables into the text.

...

  • the negative balance on the sim SIM card account.

  • low signal level;

  • the wrong format or nonexistent recipient phone number.

...

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

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

Code Block
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"`

# or for HTTPS case

#RESPONSE=`curl -s -d "querytype=auth&name=${USERNAME}&h=${HASH}" -k "https://${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

# or for HTTPS case

#curl -d "querytype=send_sms_message&k=${KEY}" --data-urlencode "to_phone=${TOPHONE}" --data-urlencode "message=${MESSAGE}" -k https://${HOSTIP}/engine.htm > /dev/null 2>&1

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