Create plugin/script to send notifications via SMS gateway
Posted: Sunday 06 August 2017 22:47
I've got a Sierra Wireless 3G/4G modem/router that allows me to send SMS messages by simply throwing it a UDP message. From the ALEOS Software Configuration User Guide:
This looks pretty straightforward, but I'm confused whether I should implement this as a Python "plugin" or a LUA "script"? Plugins seem to be more intended for "devices" such as switches, while I'm after something that will let me use it in Blockly/LUA/Python "events", similarly to how the built-in Clickatel SMS notifier works. Any pointers appreciated!Example: You want to send the following message: “Test message” to phone
number (510) 555-4200. To use this feature, convert the message to
hex:54657374206d657373616765. Then format the message as follows:
<<<15105554200,ASCII,12,54657374206d657373616765>>>
where:
· “<<<” is the start delimiter
· “15105554200” is the phone number
· “,” is the delimiter between fields
· “ASCII” is the data type
· “12” is the number of characters in the original message (before it is
converted to ASCII hex format)
· “54657374206d657373616765” is the message itself
· “>>>” is the end delimiter
Send the UDP packet to the configured ALEOS port.
After your message is sent, you receive an ACK message in the format ACK
Field acknowledgment Code ACK Field. For example, if your message was
successfully queued to be sent, you receive the message: ACK0ACK.