9 years, 4 months ago.

sending sms with sim800l

Hi all,

I am not able to send sms from sim800l

  1. include "mbed.h"
  2. include <string>

Serial pc(SERIAL_TX, SERIAL_RX); pc comunication Serial SIM900(PA_9, PA_10); tx, rx SIM 900 string result; char x;

void clearString() { result.clear(); }

void callback_rx() {

while (SIM900.readable()) { x = SIM900.getc(); result += x; pc.putc(x); print the answer from SIM900

} }

void sendSMS() {

clearString(); SIM900.printf("AT+CMGF=1\r"); at command for send sms wait_ms(1000); clearString(); wait_ms(1000); SIM900.printf("AT+CMGS="); SIM900.putc('"'); SIM900.printf("07479022226"); SIM900.putc('"'); SIM900.printf("\r"); wait_ms(1000); SIM900.printf("test1"); wait_ms(1000); SIM900.putc(0x1A); wait_ms(5000); }

int main() {

pc.printf("\r\n GSM 900 TEST\n"); SIM900.attach(&callback_rx); SIM900.baud(9600); wait_ms(100);

wait_ms(10); sendSMS(); SEND SMS pc.printf("\r\n SMS Send\n"); wait_ms(100);

}

Thanks Gautam

Can anyone help me to resolve this issue

posted by gautam tripathi 17 Jun 2016
Be the first to answer this question.