4.2 Configuration by SMS

This subsection describes how to configure 2N® SmartCom PRO via the Short Message Service (SMS).

The SMS messages described in this subsection are used for basic settings of the terminal. You have to know the phone number of the SIM card inserted in your  
2N® SmartCom PRO
to ensure a reliable function.

Caution

  • Every SMS sent to 2N® SmartCom PRO must meet all of the conditions mentioned below. Otherwise, the SMS will be ignored, no changes will be made and an error message will be sent to the SMS-sending number.

Function description

You can configure 2N® SmartCom PRO by sending short text messages to the phone number of the SIM card inserted in the terminal. Doing this, respect the below listed parameters to avoid an SMS processing error.

Every configuration SMS must meet the following conditions:

  • Device name – SC
  • Correctly formatted command (INFO, CNF, etc.)
  • Authorisation password
  • Correctly defined parameters (refer to the command parameters)
  • Upper/Lower Case must be respected
  • Parameters must be separated with a space
  • 7-bit message format (no diacritic symbols)
  • Maximum length of 160 characters (which is one SMS, concatenated SMS are not supported)

Note

  • The maximum SMS length is 160 characters. This is a GSM standard, which allows 1120 bits, i.e. 140 bytes, per SMS. Since 7-bit encoding is used by default, 20 characters are saved per 140 bytes and so the resultant length is 160 characters. The GSM 03.38 character set is applied. UCS-2 16-bit encoding is used for the characters that are not included in the ASCII standard (characters with diacritics). In that case, the SMS contains only 70 characters. Unsupporting the UCS-2 character set, 2N® SmartCom PRO cannot process such SMS correctly and marks them as errors.
  • Modern GSM devices support SMS concatenating where several standard SMS are merged into a long one. Information on each fragment of the long SMS is written into the User Data Header (UDH) and so no fragment may be longer than 153 chars in 7-bit encoding. Unsupporting the UDH encoding system, 2N® SmartCom PRO cannot process such SMS correctly and marks them as errors.

INFO SMS

Send the following message to identify the provider, IMSI, IMEI or serial number of your 2N® SmartCom PRO:

SC INFO PWD=<password>

Caution

  • Remember to enter the correct password into the SMS to avoid SMS ignoring as a SPAM.

The response to such SMS can, for example, be as follows.

SIG=-71dBm OPER=T-Mobile CZ IMSI=230015001155344 IMEI=355915030750962 SN=50-0369-0080 LIP=89.24.0.141 FW=1.2.0.2.4 STAT=CONNECTED

Caution

  • The response format depends on the current terminal mode.

The response for the TCP and UDP client modes is as follows:

SIG=<signal_level> OPER=<operator> IMSI=<sim_card_imsi> IMEI=<module_imei>
SN=<terminal_serial_number> LIP=<local_ip> FW=<terminal_fw_version> STAT=<current_terminal_status>

The response for the standalone mode is as follows:

SIG=<signal_level> OPER=<operator> IMSI=<sim_card_imsi> IMEI=<module_imei> SN=<terminal_serial_number><br>LIP=<local_ip> FW=<terminal_fw_version> STAT=LISTENING

The meanings of the parameters in the response SMS are as follows.

  • <password> – authentication password; the password has to be set up first (AUTH_PASS configuration parameter).
  • <signal_level> – current signal level in the '–XXXdBm' format.
  • <operator> – provider's name in the long format (name, no number).
  • <sim_card_imsi> – IMSI of the SIM card inserted.
  • <module_imei> – IMEI of the GSM module used.
  • <terminal_serial_number> – serial number in the 'xx–xxxx–xxxx' format.
  • <local_ip> – terminal local address (as assigned by the provider).
  • <terminal_fw_version> – terminal firmware version.
  • <current_terminal_status>  current terminal status (in the Client mode only).
    • CONNECTING – terminal is connecting to 2N® SmartCOM Server.
    • CONNECTED – terminal is connected to 2N® SmartCOM Server.
    • LISTENING – terminal is in the standalone mode.
    • DATA-OFF - terminal is in the data_off mode.

Basic Settings

The following configuration SMS sets the basic parameters necessary for a proper function of the terminal, including connection to the GSM provider and 2N® SmartCOM Server, device mode switching and RS 232 authorisation enable.

Use the following command to know the current parameter settings:

SC CNF PWD=<password>

The response to such SMS can, for example, be as follows:

MODE=1 232LCK=0 APN=publicip.t-mobile.cz DUSR= DPWD= IPS=90.182.112.51 PORTS=1620 CHPRIM=GSM

Tip

  • You can send all the parameters at once or enter only those you want to change in the configuration. Hence, you need not always send all optional parameters but have to meet the basic conditions mentioned in the Function Description above.

Now let us describe the contents of a configuration SMS and all optional parameters. 

SC CNF PWD=<password> [MODE=<mode>] [232LCK=<rs232_lock>] [APN=<gprs_apn>] [DUSR=<gprs_data_user>] [DPWD=<gprs_data_password>]<br>[IPS=<server_ip_address>] [PORTS=<server_port>] [CHPRIM=<primary_channel>] [NPWD=<new_password>]

The parameters in square brackets are optional and can be omitted. The password is the only mandatory parameter! The meanings of the CNF command parameters are as follows:

  • PWD=<password> – authentication password. The password has to be set up first (AUTH_PASS configuration parameter). The password is the only mandatory parameter in this configuration SMS!
  • MODE=<mode>  this parameter changes the mode and has the following numerical options:
    • – TCP Client
    • – UDP Client
    • 3 – STANDALONE
  • 232LCK=<rs232_lock> – if this parameter is enabled, you have to authenticate yourself by a password to be connected via the RS 232 port. 0 = disabled, 1 = enabled.
  • APN=<gprs_apn> – provider's Access Point Name.
  • DUSR=<gprs_data_user> – user name for provider connection.
  • DPWD=<gprs_data_password> – password for provider connection.
  • IPS=<server_ip_address> 2N® SmartCOM Server IP address (used in the Client mode).
  • PORTS=<server_port> – listening server port for terminal connection (used in the Client mode).
  • CHPRIM =<primary_channel> – preferred data channel entered as a text:
    • ETH
    • GSM
  • NPWD=<new_password> – new authentication password.

Tip

  • The new authentication password should contain 5 characters at least to prevent communication problems with other applications.

Tip

  • If the SMS has been created and processed correctly, 2N® SmartCom PRO will send a confirmation SMS to the number from which the original SMS was sent. The confirmation SMS contains all the new parameters and is used for verification of the set values.

Caution

  • Some GSM providers do not require user name and password for Internet connection setup. Therefore, these parameters may remain empty. Contact your provider to make sure.

Example of configuration SMS

Suppose you change the default password (to password1) and set APN to 'internet.open'. Also, set the server IP address to 90.89.126.3 and the listening port to 1658. This is the most frequent way of setting.

Thus, send the following configuration SMS:

SC CNF PWD=APNpassword=internet.open IPS=90.89.126.3 PORTS=1658 NPWD=password1

The following response comes from the terminal after processing:

MODE=1 232LCK=0 APN=internet.open DUSR= DPWD= IPS=90.89.126.3 PORTS=1658

Error buffer

An error buffer is implemented in each terminal to store data on terminal operation errors. To display the buffer contents use either the terminal (AT command) or an SMS. The SMS displays the last 10 errors starting with the most recent one.

Use the following SMS:

SC ERR PWD=<password> [CLR]
  • CLR – clears the error buffer.

Tip

  • This command includes a single optional parameter – CLR. If you add this string after the password in the command SMS, you will receive an SMS showing the current buffer contents and all errors will then be deleted from the terminal memory.

The following response comes from the terminal after processing:

1:8,10 2:3,10 1:1,0 7:8,10 6:8,7 5:7,40 4:11,848

The following response comes if there is no error in the error buffer:

NO ERROR

Note

  • Refer to SC_errors.doc for the meanings of the error codes!
  • Display the decryption table in the Terminal Config program.

Relay Control

Every terminal is equipped with two relay outputs, which can be SMS controlled. The configuration SMS must include the password and one of the four programmable parameters at least.

The programmable parameters include:

  • R1 or R2 – define the relay state:
    • – relay is closed
    • – relay is open
  • S1 or S2  define the relay state after the terminal restart:
    • – relay is closed after restart
    • – relay is open after restart
    • – relay retains the pre-restart state

Tip

  • The relay contacts get released upon power off and, normally, the terminal does not remember the relay states. Therefore, the S1 and S2 parameters have been introduced, defining to which state the relay should be switched after power up.

Example:

Suppose you want relay 1 to open now and close after restart and relay 2 to close and retain so after restart. Hence, send the following configuration SMS:

SC REL PWD=heslo R1=0 R2=1 S1=1 S2=2

The command is executed and the terminal sends the following response:

R1=0 R2=1 S1=1 S2=2

IP Access

You can also set IP address access authorisation using SMS. By enabling the IP Access you can restrict access to the terminal configuration for selected IP addresses. You can select up to 5 IP addresses.

The configuration SMS is as follows:

SC IPA PWD=<password> [AUTH=<ip_auth>] [ADD=<ip_addr>] [DEL=<ip_id>] _[REP=<ip_addr_1>,<ip_addr_2>,...<ip_addr_5>]

Now let us describe the contents of a configuration SMS and all optional parameters.

The parameters in square brackets are optional and can be omitted. The password is the only mandatory parameter! The meanings of the IPA command parameters are as follows:

  • PWD=<password> – authentication password. The password has to be set up first (AUTH_PASS configuration parameter). The password is the only mandatory parameter in this configuration SMS!
  • AUTH=<ip_auth>  this command changes the mode and has the following numeric options:
    • – disabled
    • – enabled
  • ADD=<ip_addr> – this parameter adds a selected IP address to the list end.

Caution

  • Enter the IP addresses in the numerical format only ranging from 0.0.0.0 to 255.255.255.255.
  • DEL=<ip_id> – this parameter deletes the IP address on the selected list position.

Caution

  • Select 0 in the ip_id parameter to delete all the IP addresses from the list. The SMS will be as follows: SC IPA PWD=password DEL=0.
  • REP=<ip_addr_1>,<ip_addr_2>,…<ip_addr_5> – replace the existing address list with a new one.

Example:

Suppose you want to know whether the IP access function is enabled. Send the following SMS:

SC IPA PWD=<password>

The response can be as follows, e.g.:

AUTH=1 1:90.156.29.195 2:109.54.2.234

Now disable the IP access and delete all IP addresses from the list using the following SMS:

SC IPA PWD=heslo AUTH=0 DEL=0

The following response comes from the terminal after processing:

AUTH=0 NO IP

Tip

  • NO IP means that there is no IP address in the address list.

AMS Settings

Use the SMS below to detect the M-Bus meters, assign them to the AMS list and read the current meter list.

SC AMS PWD=<password>

The command checks the meters installed.

  • PWD=<password> – authentication password. Remember to set the password via AUTH_PASS as this parameter is mandatory for the configuration SMS!

The following response comes from the terminal after processing:

<session>:<message_id>> QTY=n address#1:protocol:port:interval address#2:protocol:port:interval,..., address#N:protocol:port:interval

Meanings of the SMS parameters

  • <session> – communication thread id: 1 - 100
  • <message_id> – message id in the selected communication thread
  • QTY – count of devices in the meter list
  • address – primary_address
  • *address – *secondary_address
  • see below for more parameters
SC AMSADD PWD=<password> QTY=<n> PORT=<port> PROTOCOL=<protocol> INT=<interval> BAUDRATE=<value>

The command performs automatic installation of meters.

Caution

  • When you enter this command, the SCDATA (record memory) and meter list will be deleted!
  • The command can only be started via the interface that supports this (M-Bus).

Configuration SMS parameters:

  • PWD=<password> – authentication password. Remember to set the password via AUTH_PASS as this parameter is mandatory for the configuration SMS!
  • QTY=<n> – count of devices detected – number
    • This parameter gives the count of devices that should be connected to the bus and thus detected. This count must show a match, otherwise an error is reported (65286).
  • PORT=<port>  > – number of the physical port to which the device is connected – number
    • 1 – RS232 communication port
    • 2 – RS232/RS485/M-Bus communication port (depending on HW version)
  • PROTOCOL=<protocol> – name/number of the communication protocol used for device communication
    • for number:
      • 2 – denotes the M-Bus protocol
    • for text string:
      • "MBUS" – denotes the M-Bus protocol
  • INT=<interval> – text string of the time interval symbol (minutes/hours/days); setting options:
    • "1M", "2M", "3M", "4M", "5M", "6M", "10M", "12M", "15M", "20M", "30M", "1H", "2H", "3H", "4H", "6H", "8H", "12H", "1D" 
  • BAUDRATE=<value> – baud rate value. If the parameter is not included, the default baud rate is used: 9600. Setting options:
    • "300", "600", "1200", "2400", "4800", "9600", "19200", "38400"

The terminal sends the following response:

<session>:<message_id>> AMSADD started

Meanings of the SMS parameters

  • <session> – communication thread id: 1–100
  • <message_id> – message id in communication thread 1

The following response comes from the terminal after processing:

<session>:<message_id>> QTY=n ERR=error_code address#1, address#2,..., address#N

Message parameters:

  • <session> – communication thread id: 1–100
  • <message_id> – message id in communication thread 2
  • QTY – count of devices detected
  • ERR – error code (refer to ONF Customer Module Errors in Subs. 3.8 for details)
  • address – primary_address
  • *address – *secondary_address 
SC AMSDEVADD PWD=<password> PORT=<port> PROTOCOL=<protocol> ADDR=<address> INT=<interval> [INIT=<init_value>]


Manual Meter Installation

Configuration SMS parameters:

  • PWD=<password> – authentication password. Remember to set the password via AUTH_PASS as this parameter is mandatory for the configuration SMS!
  • PORT=<port>  number of the physical port to which the device is connected – number
    • 1 – RS232 communication port
    • 2 – RS232/RS485/M-Bus communication port (depending on HW version)
    • 128 – internal A/D input module communication port (analogue/digital input module)
  • PROTOCOL=<protocol> – name/number of the communication protocol used for device communication
    • for number:
      • 1 – denotes the IEC 62056-21 protocol
      • 2 – denotes the M-Bus protocol
      • 128 – denotes the A/D input reading protocol (for reading data from the analogue/digital input module)
    • for text string:
      • "IEC62056-21" – denotes the IEC 62056-21 protocol
      • "MBUS" – denotes the M-Bus protocol
      • "AIN_DIN" – denotes the A/D input reading protocol (for reading data from the analogue/digital input module)
  • ADDR=<address> – device address (identical with the addresses entered into the AMS; refer to Subs. 3.8)
  • INT=<interval> – text string of the time interval symbol (minutes/hours/days); setting options:
    • "1M", "2M", "3M", "4M", "5M", "6M", "10M", "12M", "15M", "20M", "30M", "1H", "2H", "3H", "4H", "6H", "8H", "12H", "1D" 
  • INIT=<init_value> – an optional parameter relevant for digital pulse inputs only, denoting the value to which the given pulse counter shall be set on the selected input.

The terminal sends the following response:

<session>:<message_id>> AMS device added

Meanings of the SMS parameters

  • <session> – communication thread id: 1–100
  • <message_id> – message id in communication thread 1

Restart

Use SMS to perform terminal system restart or GSM module hard restart. After this SMS is sent and received, you will get a response and the command will be executed. System restart means a complete terminal restart like in the event of power supply disconnection. To reset the GSM/UMTS module only without affecting other peripheral functions, use the GSM hard reset command.

The system restarting SMS is as follows:

SC SRST PWD=<password>
  • PWD=<password> – authentication password. Remember to set the password via AUTH_PASS as this parameter is mandatory for the configuration SMS!

The following response comes from the terminal after processing:

System Reset Initialized

The GSM/UMTS module forced restart SMS is as follows:

SC GSMHRST PWD=<password>
  • PWD=<password> – authentication password. Remember to set the password via AUTH_PASS as this parameter is mandatory for the configuration SMS!

The following response comes from the terminal after processing:

GSM Hard Reset Initialized

Factory reset

Use SMS to initiate the terminal factory reset. After this SMS is sent, you will get a response and the command will be executed.

The SMS is as follows:

SC FRES PWD=<password>
  • PWD=<password> – authentication password. Remember to set the password via AUTH_PASS as this parameter is mandatory for the configuration SMS!

The following response comes from the terminal after processing:

<session>:<message_id>> Factory Reset Initialized

Message parameters:

  • <session> – communication thread id: 1–100
  • <message_id> – message id in the selected communication thread

Error Responses

Having noticed an error in the configuration SMS or command processing, 2N® SmartCom PRO sends you an error response. If the terminal generated an error response, it means that the command had not been executed!

Tip

  • 2N® SmartCom PRO sends error responses until all the configuration SMS parameters are OK and the command can be executed.

The following errors can occur:

  • ERR Unknown command – an unknown command has been entered. The following commands are only allowed: INFO, CNF, ERR, REL, IPA.
  • ERR Password missing – the configuration SMS fails to include the password, i.e. the PWD=”password” string.
  • ERR Password incorrect – the password is wrong.
  • ERR Too many parameters – the configuration SMS contains more than 160 characters or was sent as a 16-bit message (with diacritic symbols and/or substandard characters).
  • ERR Unknown parameter – an unknown parameter has been entered. Refer to the commands for all allowed parameters.
  • ERR Parameter value incorrect – the parameter value is beyond limits.