[ENG] 9.8. [DKSF 54.2 IU] How to Control a Device Using SMS Commands

A device has a possibility to be controlled remotely using SMS commands.

Syntax of SMS Commands

A general format of a text of an SMS command is as follows:

NETPING fff community_w kkkkk

where:

fff – is a command code, for example, Р1+ (see below).

community_w – is a password that corresponds to an SNMP community for write. It is indicated at the page «SETUP» of a device web interface. It is possible to use Latin letters, numbers, character «_» without quotes and spaces.

kkkkk – is a request identifier (a random number). It is repeated in a response to set a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response.

A text of a command is case-insensitive, it is possible to use uppercase and lowercase letters. Elements of a command are separated by spaces. It is not acceptable to use the next characters: ‘ (apostrophe), “ (quote), @. Including these characters can cause a firmware failure. An execution of a command is configured by a response notification (see below).

Command Codes

A command code is indicated as one word, without spaces.

Command CodeDescription
Pn+Switch on a relay n, where n is a relay number
Pn-Switch off a relay n, where n is a relay number
PnR

Reload a relay n, where n is a relay number

A polarity (direction) of switching a relay when resetting must correspond to a specified one in the settings of the module «Watchdog» (reset mode). If a relay already has a reset status, a reset command will not have any effect, however, a response notification about a successful execution «NP DONE PnR» will be sent to a destination number.

PnWSwitch a relay n into the management mode «Watchdog», where n - is a relay number
PnSSwitch a relay n into the management mode «Schedule», where n - is a relay number
PnXSwitch a relay n into the management mode «Schedule+Watchdog», where n - is a relay number (in the process of development)
PnLSwitch a relay n into the management mode «Logic», where n - is a relay number
Pn?Request a status of a relay n, where n - is a relay number
P?Request a status of all relays in a brief form
N?Request a status of a pinger
Tb?Request readings of a temperature sensor b, where b - is a number of a temperature sensor
Hx?Request readings of a humidity sensor x, where x - is a number of a humidity sensor
A?Request a status of a battery

Examples of SMS Commands

A command for switching on a relay 1 of a device:

NETPING P1+ SWITCH

A command for switching off a relay 2 of a device:

NETPING P2- SWITCH

Response Notifications to SMS Commands

A confirmation for executing a command, such as switching a relay:

NP DONE fff kkkkk

where:

fff – is a code of an outgoing command, executing which is confirmed by this notification. For example, Р1+

kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response

 

An error while a device reads a command. Most probably, a text of an outgoing command is incorrect:

NP WRONG CMD: "outgoing command kkkkk"

where:

Outgoing command  is a text of an outgoing command, which is quoted completely.

kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response

 

An incorrect password (Community) in an outgoing command:

NP WRONG PASSWD IN kkkkk

NP WRONG PASSWD

where:

kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response (the second command)

Response Notifications to SMS Commands for Requesting a State/Status

A response to a request (NETPING Pn? community_w kkkkk) about a relay status:

NP REPLY Pnb kkkkk

where:

n  is a relay number

b  is a relay status, a possible status of a relay is coded by the next characters: «+» (switched on), «-» (switched off), «W+»/«W-» (watchdog), «S+»/«S-» (schedule), «X+»/«X+» (schedule+watchdog), «L+»/«L-» (logic).

kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response

 

A response to a request (NETPING P? community_w kkkkk) about a status of all relays:

NP REPLY P1b P2b P3b P4b kkkkk

where:

b  is a status of a relay, possible status of a relay is coded by the next characters: «+» (switched on), «-» (switched off), «W+»/«W-» (watchdog), «S+»/«S-» (schedule), «X+»/«X+» (schedule+watchdog), «L+»/«L-» (logic).

kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response

 

A response to a request (NETPING N? community_w kkkkk) about a status of a pinger, embedded into an SMS module:

NP REPLY N=1 kkkkk

NP REPLY N=0 kkkkk

where:

N=1 – an indicated address responds

N=0 – an indicated address is silent

kkkkk – a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response

 

A response to a request (NETPING Tb? community_w kkkkk) about readings of a temperature sensor. A sensor with a number b failed or is not connected:

NP REPLY Tb=? SENSOR FAILED kkkkk

where:

b  is a number of a temperature sensor

kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response


A response to a request (NETPING Tb? community_w kkkkk) about readings of a temperature sensor. A sensor with a number b is in a status «below», «normal», «above normal» respectively:

NP REPLY Tb=tC BELOW SAFE RANGE (t1..t2C) kkkkk

NP REPLY Tb=tC IN SAFE RANGE (t1..t2C) kkkkk

NP REPLY Tb=tC ABOVE SAFE RANGE (t1..t2C) kkkkk

where:

b  is a number of a temperature sensor

t – is a current temperature value, in °C

t1, t2 – are thresholds of a «normal range» of a temperature, in °C

kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response

 

A response to a request (NETPING Hx? community_w kkkkk) about readings of a humidity sensor. A sensor with a number x failed or is not connected:

NP REPLY Hx=? SENSOR FAILED kkkkk

where:

x – is a  number of a humidity sensor

kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response

 

A response to a request (NETPING Hx? community_w kkkkk) about readings of a humidity sensor. A sensor with a number x is in a status «below normal», «normal», «above normal» respectively:

NP REPLY Hx=h% BELOW SAFE RANGE (h1..h2%) T= tC kkkkk

NP REPLY Hx=h% IN SAFE RANGE (h1..h2%) T= tC kkkkk

NP REPLY Hx=h% ABOVE SAFE RANGE (h1..h2%) T= tC kkkkk

where:

– is a current value of a relative humidity, in %

h1, h2 – are thresholds of a «normal range» of a relative humidity, in %

t – is a current temperature value, in °C

kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response

 

A response to a request (NETPING A? community_w kkkkk) about a battery status:

NP REPLY A? POWER SCR: V, CHARGING: C kkkkk

where:

– is a power supply source, and can have the values: «220V» (220V grid power), «BATTERY» (battery power)

С – is a battery status, and can have the values: «OK» (battery is full), «LOW» (battery is low)

kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response