AnsweredAssumed Answered

SIM800 with stm32f334

Question asked by tripathi.gautam on Jun 9, 2016
Latest reply on Jun 9, 2016 by Clive One
Hi all;
I am trying to send sms using sim800l module with stm32f334

#include "mbed.h"
#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()
{
 
//SIM900.putc('"');
  SIM900.printf("AT+CMGF=1\r"); //at command for send sms
 // SIM900.putc('"');




wait_ms(1000);
//SIM900.putc('"');
SIM900.printf("AT+CMGS=\"+074xxxxxx\"\r\n");
//SIM900.putc('"');






wait_ms(1000);
SIM900.printf("test1");
wait_ms(1000);
SIM900.putc((char)26);
wait_ms(5000);
}
 
 
int main() {
 
pc.printf("\r\n GSM 900 TEST\n");
SIM900.attach(&callback_rx);
SIM900.baud(9600); //
wait_ms(100);
 
sendSMS();  // SEND SMS
pc.printf("\r\n SMS Send\n");


 wait_ms(100);
 
}

I dont know what is going wrong. Please help me 

Outcomes