waqasaps2 / gsm-shield-arduino

This library can be used with GSM shield
0 stars 0 forks source link

SMS example does not read back messages. #63

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Upload GSM_GPRSLibrary_SMS.ino
2.
3.

What is the expected output? What do you see instead?
I was expecting the equivalent of 
AT+CMGL="ALL"

But in the loop() the line: 
   if(gsm.readSMS(smsbuffer, 160, n, 20))...
never tests true and no SMS messages are read out.  I will look into SIM900.cpp 
when I get a chance (I think that's where the issue is) but my coding skills 
are very basic so I'm not sure I'll be able to fix anything.

FYI, code will automatically send an SMS message if 
   if (sms.SendSMS...
is uncommented, that part works fine.

What version of the product are you using? On what operating system?
- Arduino 256 MEGA (with ifdef's modified for MEGA)
- Sim900 on GPRS Shield by SeeedStudio 
- Windows 7 pro (32 bit)

Please provide any additional information below.
Great library!

Original issue reported on code.google.com by kue...@gmail.com on 20 Feb 2013 at 3:12

GoogleCodeExporter commented 8 years ago
At a glance,
shouldn't gsm.readSMS be gsm.getSMS ???

there seems to be no actual 'readSMS' function in the library. There is a 
'IsSMSPresent' function to check for the location of any unread messages, and 
the getSMS function which outputs it.

dean.huczok

Original comment by cabledup...@gmail.com on 27 Feb 2013 at 10:17

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
glad im not the only one with this issue, i got the following to work

if(sms.GetSMS(8,n , smsbuffer,160)) //where 8 represents the index of the sms, 
im such a noob i haven't figured out as yet how to read the latest sms on the 
sim card

you can change the figure 8 to anything value it appears to be the location of 
text with regards to their arrival, e.g. number "8" was the 8th message my sim 
card received and "4" would be the 4th message etc

Original comment by mrharvey...@gmail.com on 28 Feb 2013 at 3:02

GoogleCodeExporter commented 8 years ago
Use sms.GetSMS((int)pos,number,message,180); not the other one.
Marco

Original comment by martines...@gmail.com on 8 Mar 2013 at 10:47

GoogleCodeExporter commented 8 years ago
This issue section is not longer supported.
Please check the support page www.gsmlib.org 

Original comment by martines...@gmail.com on 6 Jul 2013 at 11:27