Send a SMS
In previous generations, the digisms Python module was used to send SMS messages:
- Invoke the send(address, message) function with the SMS destination and the message to send.
Previous API
import digisms
import time
ADDRESS = "15551234567"
MESSAGE = "Hello, World!"
cur_time = time.strftime("%a, %d %b %Y %H:%M:%S", time.gmtime())
msg = "%s: Message %s" % (cur_time, MESSAGE)
digisms.send(address, msg)
In the new XBee gateways, the digidevice.sms Python module is used to send SMS messages:
- Invoke the send(address, message) function with the SMS destination and the message to send.
New API
from digidevice import sms
import time
ADDRESS = "15551234567"
MESSAGE = "Hello, World!"
cur_time = time.strftime("%a, %d %b %Y %H:%M:%S", time.gmtime())
msg = "%s: Message %s" % (cur_time, MESSAGE)
sms.send(address, msg)