2016-06-08 05:21 PM
Hi all;
I am trying to send sms using sim800l module with stm32f334&sharpinclude ''mbed.h''&sharpinclude <string>Serial pc(SERIAL_TX, SERIAL_RX); // pc comunicationSerial SIM900(PA_9, PA_10); //tx, rx SIM 900string 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 SMSpc.printf(''\r\n SMS Send\n''); wait_ms(100); }I dont know what is going wrong. Please help me #stm322016-06-08 07:45 PM
Are you seeing any response from the modem? Can you send other AT commands and see responses? Have to made sure you can read the SIM, and that the modem has registered to the network?
The message format command should probably have a CR and LF Does the sms message send respond with an ERROR, or a caret > expecting the message