4.2 Configuration by SMS

The SMS messages described in this section are used for basic settings of the terminal. You have to know the telephone 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 Desription

You can configure 2N® SmartCom PRO  by sending short text messages to the telephone 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:

  • Name of device – '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 SMS 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. Not supporting the UCS-2 character set, 2N® SmartCom 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. Not supporting the UDH encoding system, 2N® SmartCom 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 reply to such SMS can, for example, look 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 reply format depends on the current terminal mode.

The reply 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 reply for the STANDALONE mode is as follows:

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

The meanings of the parameters in the reply 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> – local address of the terminal (assigned by the provider).
  • <terminal_fw_version> – terminal firmware version.
  • <current_terminal_status> – current terminal status (in the Client mode only).
    • CONNECTING – terminal connection to 2N® SmartCom Server in progress.
    • CONNECTED – terminal connection to 2N® SmartCom Server completed.
    • 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 Server2N® SmartCom PRO  mode switching and RS 232 authorisation enable.

Use the following command to know the current parameter settings:

SC CNF PWD=<password>

The reply to such SMS can, for example, look as follows:

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

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>] [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
    • – STANDALONE
  • 232LCK=<rs232_lock> – this parameter enforces authorisation on the RS232 port. If enabled, you have to authorise yourself by the password to get connected via this 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 authorisation password.

Tip

  • The new authorisation 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 recently set 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, contact your provider to make sure.

Example of configuration SMS:

Suppose you want to change the default password (into password 1) 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 reply will come 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 (an AT command) or an SMS. The SMS displays the last 10 errors starting with the most recent one.

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

Tip

  • This command includes one 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 reply will come 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 reply will come if there is no error in the error buffer: 

NO ERROR

Note

  • Refer to SC_errors.doc for the meanings of the error codes!

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 (on)
    • – relay is open (off)
  • 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 gets off (contacts get released) after 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 be switched into the open state now and into the closed state after restart, and relay 2 to close and retain so after restart. Hence, send the following configuration SMS:

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

The command will be executed and the terminal will send the following reply:

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 will restrict the access to the terminal configuration to selected IP addresses. You can select up to 5 different 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 the 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 parameter changes the mode and has the following numerical options:
    • – disabled
    • – enabled
  • ADD=<ip_addr> – add a selected IP address to the list end.

Caution

  • Enter the IP address in the numerical format only ranging from 0.0.0.0 to 255.255.255.255.
  • DEL=<ip_id> – delete 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 reply can, for example, look as follows:

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= AUTHpassword=0 DEL=0

The following reply will come from the terminal: 

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 reply 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>

The command performs installation of meters.

Caution

  • When you enter this command, the SCDATA (record memory) and meter list will be deleted!

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 the devices that should be connected to the bus and thus detected. This count must show a match, otherwise an error will be reported (65286).
  • PORT=<port>  number of the physical port to which the device is connected - number
    • 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 - A/D input protocol (analogue/digital input module data reading protocol)
    • for text string:
      • "IEC62056-21" - denotes the IEC 62056-21 protocol
      • "MBUS" - denotes the M-Bus protocol
      • "AIN_DIN" - A/D input protocol (analogue/digital input module data reading 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" 

The terminal sends the following reply:

<session>:<message_id>> AMSADD started

Message parameters:

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

The following reply 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

Restart

Use SMS to perform terminal system restart or GSM module hard restart. After this SMS is sent and received, you will get a reply and the command will be executed. System restart means complete terminal restart like in the event of power supply disconnection. To reset the GSM 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 terminal sends the following reply:

System Reset Initialized

The GSM hard reset 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 terminal sends the following reply :

GSM Hard Reset Initialized

Factory Reset

Use SMS to initiate the terminal factory reset. After this SMS is sent, you will get a reply 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 terminal sends the following reply :

<session>:<message_id>> Factory Reset Initialized

Message parameters:

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

Error Replies

Having noticed an error in the configuration SMS or command processing, 2N® SmartCom PRO  will send you an error reply. If the terminal generates an error reply, it means that the command was not executed!

Tip

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

The following errors can occur:

  • ERR Unknown command – an unknown command has been entered. Five commands are 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 incorrect.