Versions Compared

Key

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

...

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).

LTE mode

Если встроенный модем поддерживает LTE режим передачи данных, то в окне настройки модема появится вкладка If the built-in modem supports LTE data transfer mode, the "LTE mode" . По умолчанию режим отключен. Чтобы его включить, нужно установить флаг tab will appear in the modem setup window. By default, the mode is disabled. To enable it, you need to set the flag "Enable LTE", указать номер телефона для соединения с провайдером specify the phone number for connection with the provider "Phone for connection", указать точку доступа specify the access point "Access point (APN)". Если дополнительно требуется аутентификация пользователя, то нужно установить соответствующий флаг и указать имя и пароль пользователя If you additionally require user authentication, you need to set the appropriate flag and specify the user name and password.


После нажатия кнопки After clicking "OK" или or "Apply", настройки режима LTE будут сохранены и через несколько секунд модем перейдет к установке соединения с провайдером. О ходе соединения можно судить по полю "Status" в окне настройки модема.

Warning

После установки LTE соединения через модем, отправка SMS, проверка баланса и уровня сигнала станут невозможны, т.к. модем находится в режиме передачи данных.

...

LTE mode settings will be saved and after a few seconds the modem will proceed to establish a connection with the provider. The progress of the connection can be judged by the "Status" field in the modem setup window.

Warning

After installing LTE connection via modem, sending SMS, checking balance and signal level will be impossible, because the modem is in the data transfer mode.


Info

If you disable LTE mode, after clicking the "OK" or "Apply" button, the device will reboot. Be careful, save the changes made in the system before this.