MarcoMartines / GSM-GPRS-GPS-Shield

GSM/GPRS & GPS Shield Library for modules using SIM900/SIM908
GNU General Public License v2.0
208 stars 152 forks source link

Send Custom AT Commands #31

Open Erwinstein opened 8 years ago

Erwinstein commented 8 years ago

Hello. I'm trying to get the current SIM's mobile number. I believe this is done via sending AT commands to the GSM Shield. However I am very much a newbie with Arduino and C++. How do I send my own AT commands to the GSM Shield using the functions in the library?

I believe I will use something like gsm.SimpleWriteln() and gsm.read() but I can't make it work. I want it to particularly get the mobile number (I believe it is AT+CNUM). I want to send this command and then read the response to get the mobile number. How can I do this? Thank you.

lxnk commented 8 years ago

If you want to use directly AT commands, you don't need this library. Use SoftwareSerial (or Serial if you connect your SIM900 shield to pins 0 and 1). And do simply read()/write() commands of these classes.