26.2 SMS Receiver
There are two types of command signals used in SMS Receiver:
- System:
- reboot wcc/reboot modem – when sending a message with text reboot, the device starts rebooting and after a successful reload sends back a message to the sender with text REBOOT OK.
- switch sim – after sending a message with text switch-sim, the device should switch sim and send an SMS from the new sim card with the interface name and IP address.
- show ip – the sender can request the IP address of the receiving device.
- Signal:
- publish – executes publish to a certain tag after sending a text message, which will be indicated in the configuration field tag_job_todo. For example, if tag_job_todo is led=%f, after sending a text message led=1, a publish will happen to a tag that's linked with this signal.
Configuration
Devices sheet:
Parameter |
Type |
Description |
Required |
Default Value (when not specified) |
Range |
|
Min | Max | |||||
name | string | User-friendly name for a device | Yes | |||
description | sting | Description of a device | No | |||
device_alias | string | Alphanumeric string to identify a device | Yes | |||
enable | boolean | Enabling/disabling of a device | No | 1 | 0 | 1 |
protocol | string |
Protocol to be used |
Yes | sms receiver | ||
host | string |
Telephone number from which to receive SMS |
Yes | [all, +37061111111] (case-sensitive, separated by command or space) |
When the host is set to all, only the job_todo=signal type is allowed.
Signals sheet:
Parameter |
Type |
Description |
Required |
Default Value (when not specified) |
Range |
|
Min | Max | |||||
signal_name | string | User-friendly signal name | Yes | |||
device_alias | string | Alphanumeric string to identify a device | Yes | |||
signal_alias | string | Unique alphanumeric name of the signal to be Yes used | Yes | |||
enable | boolean | Enabling/disabling of an individual signal | No | 1 | 0 | 1 |
job_todo |
string |
Choose command type | Yes |
[SIGNAL, SYSTEM] (case-insensitive) |
||
tag_job_todo | string |
which command to execute (if signal, then configure the SMS) |
[REBOOT WCC, REBOOT MODEM, SWITCH SIM, SHOW IP, <CUSTOM>%F] (case-insensitive) |
When configuring the publish signal, the command that will be received needs to be specified. Instead of %f a number will be sent to the receiver as a text message. For example, if the configuration specifies that tag_job_todo is led=%f, then after sending a message to a device led=50, the signal will publish a number 50 to an indicated tag.
Configuration example
The following example will show how to create a configuration for WCC Lite which would allow rebooting a device or modem, changing the active SIM card, showing the IP address, and turning on the red status LED, using SMS receiver and internal data. For this 2 working SIM cards and WCC Lite with modem will be needed.
The devices sheet should look like this:
For the device SMS receiver admin host should be changed to a phone number from which commands will be received, because for this device signals will be system type. For the device SMS receiver host can be either all or the same phone number.
Signals sheet:
Signal LED red fault is linked with signal sms-led as a source. This means that after sending an SMS message to a device with text led=1, red status led will turn on. The rest of the signals are system type so after sending an SMS message a certain event will happen. For example, after sending a message with the text reboot-wcc, the device should start rebooting and after the process is done it will send back a message "REBOOT WCCLITE OK". The same thing would happen after rebooting the modem. With system signals it is also possible to switch between SIM cards or request IP address via text message.
Configuration --> Download
Note: SMS Receiver can only accept messages that contain less than 160 characters.