What I want to achieve:
Send an sms from SIM900 module connected to Nano
Libraries used
MarcoMartines Library (GitHub - MarcoMartines/GSM-GPRS-GPS-Shield: GSM/GPRS & GPS Shield Library for modules using SIM900/SIM908)
What I’ve tried:
- Send sms from Mega & library >>> Works w/ SIM900 Rx/Tx to MEGA’s 18/19. SIM900Mega_Library.ino
- Sending sms w/o library w/ Sketch >>> Fails SIM900NanoW_OLibrary.ino — wow, it worked!
- Interfacing with the SIM900 directly >>> Fails SIM900NanoSSConnect.ino
- Trying to make library work >>> Ive gotten the farthest with this option SIM900NanoWLibrary.ino
Results of each:
1/4-sms sent…im uploading the results
2/4-no sms sent…im uploading the results
3/4-CREG comes back 0,0 or 0,2 or 0,4 but never 0,1 or 0,5 which means its registered on the network
4/4-no sms sent…im uploading the results
I know its not the library for that module, since the library is for the shield.
As it turns out, the library uses a #ifdef MEGA to use Serial1 (18,19) to communicate with between the mega and the sim900. I messed around with the library and replaced all the Serial1 references (in HWSerial.cpp) with Serial, which sort of makes it work with the nano when I plug in the Rx/Tx from the module to the nano’s Rx/Tx pins. I can see the data coming in from the module and it prints out everything indicating the sms was sent, but I don’t get the sms on my phone.
I know the sim works because when I use it on the mega the sms is sent successfully and then I move the sim to another phone I can also send sms messages from it.
Yesterday all of a sudden it worked with scenario #2, the AT commands directly without the library. I was able to send about 3 messages. Today its not working anymore. So the code should be good. I dont know what to do in order to figure out why it works sometimes but not others.
1Code&Results.pdf (59.7 KB)
2Code&Results.pdf (37.8 KB)
3Code&Results.pdf (35.6 KB)
4Code&Results.pdf (168 KB)