Hi, I have a project that need to send sms notification when there is input signal to my Arduino Uno. I have done all my code all on Arduino Uno. Just need to call sms function as an output.
How do i link up with my MKR GSM 1400? Do I need to connect via TX RX for both micro-controller? Using TX RX how output to be send to MKR GSM 1400 so it will send sms?
Below is my testing with MKR GSM 1400:
// Include the GSM library
#include <MKRGSM.h>
#define PINNUMBER ""
// initialize the library instance
GSM gsmAccess;
GSM_SMS sms;
void setup() {
// initialize serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("SMS Messages Sender");
// connection state
bool connected = false;
// Start GSM shield
// If your SIM has PIN, pass it as a parameter of begin() in quotes
while (!connected) {
if (gsmAccess.begin(PINNUMBER) == GSM_READY) {
connected = true;
} else {
Serial.println("Not connected");
delay(1000);
}
}
Serial.println("GSM initialized");
char txtMsg[200] = "Test";
char remoteNumber[20] = "97702265";
sms.beginSMS(remoteNumber);
sms.print(txtMsg);
sms.endSMS();
Serial.println("\nCOMPLETE!\n");
}
void loop() {
}