-
Notifications
You must be signed in to change notification settings - Fork 215
SMS Messages
A super cool feature of the shield is that you can also send and receive text messages! This can be very useful for SMS-initiated sensors, security system SMS alerts, etc. For this tutorial I'll be using the Hologram.io developer SIM card and I'll explain the different ways you can send and receive texts and automatic replies to certain text messages!
The easiest way to send a test text message is to load the "LTE_Demo" sketch as described here. Enter the "s" command and then type in your phone number, making sure to also type the country code at the beginning without spaces or "+" sign. For example, I live in the United States so I would simply type "1XXXYYYZZZZ" without spaces or dashes. It should send the SMS and you should see it on your phone within a few seconds!
Now to test receiving a text, let's first go to the Hologram Dashboard and click on the "Devices" tab on the left hand side. Click the device you're interested in and then click on the "SMS" tab:
Simply enter the message you want to send to the SIM7000 shield and press Send!
Using the same "LTE_Demo" sketch, enter the command "R" to read all SMS messages. You should see the test message appear! To delete it so that you don't stockpile messages, use the command "d" and enter the one you want to delete.
One thing that might be cool is to send an automated reply to a message. Upload the example sketch here that I've created based on an example sketch from Adafruit that allows you to send a canned response to an incoming text. Whenever the shield receives an SMS it will reply with a canned response (which I've made a sensor reading instead to make it more interesting) to the originator of the SMS.
To test it out, go to the same Hologram Dashboard and this time enter your phone number in the second field, including your country code (no special characters or spaces!).
This time when you send the SMS the shield will know where it's supposed to reply to and send a reply to the phone number you specified!