IOT is all about exchange of data and processing of that exchanged data. Surilli GSM was designed which primarily focused on providing a generic device that covers your processing needs and has a built-in communication module (SIM800H). In this tutorial we are going to use Surilli GSM and its GSM library to receive messages being sent to your Surilli and store them in a variable for any type of use. DO NOT PANIC. Our library has it all covered up for you.
STEP 1: Insert the SIM card.Insert the SIM card into your Surilli as shown in the picture below. Make sure your sim is active and inserted properly.
After you have connected both the battery and your antenna to Surilli as shown in the picture below, wait for the blue light to get stable (mostly gets stable after 8-12 fast blinks).
Stable blue light means you are successfully connected to the GSM network/network provider.
Open a new sketch and write the code or download the sketch from attachments.
About the code:
Enter the phone number with country code as an argument if you want to receive the messages from the provided number only. If you want to receive all the messages irrespective of which number it is coming from, simply pass "0000" as the argument.
Note: Arguments only take string arguments. If your message has a different data type, (integer, char variable etc) convert it to string first.
STEP 4: Upload & Run The SketchCheck that you have selected the right board, processor and port number against your Surilli as follows.
Your port number might vary.
Complete code:#include <SmsReceive.h>
int _pin=13;
String s;
SmsReceive smsreceive("+92333xxxxxxx"); //Enter Number you want to only receive message from e.g. "+923001111111" or Enter "0000" to receive message from any mobile number.
void setup() {
// put your setup code here, to run once:
smsreceive.Setup();
}
void loop() {
// put your main code here, to run repeatedly:
s = smsreceive.Receive();
Serial.println("Message = " + s+ ".");
}
Comments