SMS Protocol Configuration

From Phobos Wiki
Revision as of 16:31, 22 November 2013 by MarkTomm (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Configuring GWS

Prerequisites:

  • GWS version 6.0.5.1770 or newer is required to configure the SMS protocol.


Adding a protocol

In GWS add a new port and choose SMS from Protocol drop-down menu as illustrated below (Port7):

Sms gws port add.png


Sms port column will now have an Add Phone cell in IP Address row (Port7). Click on the Add Phone to access the configuration window as illustrated below:

Sms gws add phone.jpg
  • Phone: Enter the phone number (International Country Calling Code is required) Default: None Type: String
  • Max number of daily SMS'es: Maximum amount of SMS'es the entered number can receive¹ Default: 50 Type: Integer.
  • Allow reboot command: Allow rebooting the device via SMS using configured phone number Default: Unchecked Type: Check Box.
  • Allow commands (digital and analog): Allow sending control commands via SMS using configured phone number Default: Unchecked Type: Check Box.


By default the SMS port is forbidden for all objects (in our case Port7 as illustated below):

Sms gws objects.jpg


Interacting with the device via SMS protocol

Prerequisites:

  • A configured device in 3G network range that has a 3G modem that is turned on and has a valid SIM Card inserted (at the time of writing this text the only available option was GWM)


NB! Receiving a message may sometimes take a couple of minutes.

Available SMS messages

MESSAGE CONTENT DESCRIPTION NEGATIVE DEVICE RESPONSE POSITIVE DEVICE RESPONSE ADDITIONAL INFO
* IP The device will respond with SIM Card Ip address. - <SIM Card Ip address> -
* CSC The device will reset the current SMS counter state to 0. - SMS counter reset This command will be valid even if the daily SMS limit is reached
* REBOOT The device will be rebooted Insufficient privileges for reboot successfully rebooted This command requires "Allow reboot command" Check Box to be checked
* CTRL object_address value² The device will set the object at object_address to the requested value *Control Failed: Not Allowed in GWS
*Control Failed: Invalid address value
*Control Error: Such address does not exist
*Wrong input value: value
Control Successful This command requires "Allow commands (digital and analog)" Check Box to be checked

NB! Messages in lowercase and mixed upper- and lowercase are also valid (f.ex Ip or reBoot or csc)

Receiving SMS on certain events

SMS protocols can be separately configured to send messages to the configured phone number when certain object values change. This can be done by removing the specific SMS protocol port number from Forbidden Ports column for the required object.

Sms gws objects.jpg


Advanced

Prerequisites:

  • Established terminal connection to the device.


Additional information about 3G modem status can be viewed with the dynmotd command as well as in /tmp/log/modem.st file.

Detailed log information about SMS events can be vieved in /tmp/log/messages .

Sms counter file is located in /var/local/telem/sms/<phone_number>/sms_counter

Varius stamp files and next message content can be found in /tmp/sms/<phone_number>



¹ Sending a message and receiving an answer is considered as one SMS (counter will be incremented once). Receiving a message in case of an event change (without previously sending) is considered as one SMS (counter will be incremented once).

² If controlling digital output "ON" and "OFF" can be used as value to switch digital output on and off respectively.


MarkTomm 22. november 2013, kell 18:31 (EET)