project_quest
Newbie level 3
- Joined
- Aug 31, 2013
- Messages
- 3
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 22
Hey Everyone,
I'm working on sending and receiving texts on SIM300 interfacing it with an arduino uno.The sending bit and the subsequent display on an LCD screen has been performed sucessfully.However,I'm facing issues with the receiving bit while communicating with the GSM modem using an arduino. Meaning,I'm able to read the received texts by typing in AT commands on the hyperTermminal window but not so on the serial monitor.On the serial monitor i see a meaningless display of numbers and symbols.
My code and screen shots of my serial monitor window for receiving sms onto the SIM300 are enclosed here.
Please help!
I'm working on sending and receiving texts on SIM300 interfacing it with an arduino uno.The sending bit and the subsequent display on an LCD screen has been performed sucessfully.However,I'm facing issues with the receiving bit while communicating with the GSM modem using an arduino. Meaning,I'm able to read the received texts by typing in AT commands on the hyperTermminal window but not so on the serial monitor.On the serial monitor i see a meaningless display of numbers and symbols.
My code and screen shots of my serial monitor window for receiving sms onto the SIM300 are enclosed here.
Code:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(9,10);
char incomingByte=0;
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
pinMode(13, OUTPUT);
mySerial.println("AT");
delay(2000);
mySerial.println("AT+CMGF=1");
delay(2000);
mySerial.println("AT+CSMP=17,167,0,0");
//mySerial.println("AT+CNMI=3,3,0,0");
delay(2000);
}
void loop()
{
mySerial.write("AT+CMGL=");
mySerial.write(34);
mySerial.write("ALL");
mySerial.write(34);
mySerial.write(13);
mySerial.write(10);
while (mySerial.available() > 0)
{
incomingByte = mySerial.read();
if(incomingByte!='/n')
{
Serial.print(incomingByte);
}
if(incomingByte=='/n')
{
Serial.println(incomingByte);
}
}
}
Please help!