Versions Compared

Key

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

...

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

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

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

Команды установки импульса реле (розетки)Relay (Socket) pulse setting commands.

Syntax. set [id]  pulse {duration} или set  or set  [name] pulse {duration}, где id – номер элемента, name – название элемента, duration – время задержки в секундах. Поле name чувствительно к регистру. Диапазон значений поля duration от 1 до 120. Поле duration необязательно указывать, применяется ранее установленное значение. Description. Команда два раза переключает состояние реле (розетки) на противоположное, с временной задержкой, указанной как параметр duration в секундах where ID is the 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” - подача импульса на реле c номером 1004 с задержкой 15 секthe impulse to the relay number 1004 with a delay of 15 seconds;

  • “set Relay-1 pulse 110” - подача импульса на реле c именем Relay-1 с задержкой 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

Команды управления логикой (логикамиLogic control commands (logic).

Syntaxlogic [id] [state] {duration},  logic * [state], где id – номер логики (символ where ID – the number of the logic (the symbol '*' для всех логик), state – состояние, в которое переходит логика for all logics), state - the state into which the logic goes ("off", "on"), duration – время отключения логики в секундах. Все поля не чувствительны к региструduration - the time of logic shutdown in seconds. All fields are case insensitive.

Description. Команды отключают или включают логику. Время (duration) указывается только при отключении одной логики Commands disable or enable logic. The duration is indicated only when one logic is disabled

Illustration.

  • "logic 1 off 10" - отключение логики с номером 1 на 10 секундdisabling logic with the number 1 for 10 seconds;
  • "logic 1 on" - включение логики с номером the inclusion of logic with the number 1;
  • "logic * off" - отключение всех логик на 24 часаdisabling all logs for 24 hours;
  • "logic * on" - включение всех логик including all logics.

...

Hot swappable sim card (Hot Swap).

Начиная с версии прошивки системы 2.2.0 добавлена возможность замены сим-карты: не отключая питание системы можно извлечь и через некоторое время обратно вставить туже либо другую sim-карту. При извлечении sim-карты в журнале системы выдается сообщение 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" . При отсутствии sim-карты через каждые 15 минут модем автоматически перезапускается, при этом очередь sms-сообщений сохраняется.

Отправка SMS при помощи сторонних программ, скрипта

Для отправки SMS можно использовать, например, утилиту cURL. Либо другие программы, с аналогичной функциональностью.

...

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, script

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

...