What AT Command should I send to SIM800H to get response like SIM900 ?
I am doing a GSM project using PIC18F45K22 and GSM3 Click from mikroElektronika. The GSM3 Click example given by mikroE works fine but my code doesn't work. In mikroE example code they are checking for "OK\r\n" responses. In my code I am checking for "\r\nOK\r\n".
In SIM800 AT Command manual it just shows OK for the responses but doesn't mention whether it will be OK\r\n or \r\nOK\r\n. How to make SIM800H give responses similar to SIM900 ? I am having difficulty porting my SIM900 code to SIM800.
I am attaching the project which works fine. I have another code which works with SIM900 but that is not working with SIM800H.
The SIM800 is compatible with the SIM900, except SIM800 uses USB and SIM900 uses RxD, TxD for debug port, in addition to other interface differences, Vcc range etc.
Now, I modified my code a little and except AT+CMGR command everything is working. The AT+CMGR command is not working because the SMS index is not being extracted properly.
I am attaching my project. Please have a look at it. It is written using mikroC PRO PIC compiler. It is device control by SMS. The same code works fine with SIM900. Don't know why SMS index extraction is giving incorrect value. I am testing in hardware.
I did one more test. The +CMTI response given by SIM800 is same as SIM900. So, the code which works for SIM900 should work with SIM800 but it is not working.
This is what is happening. See it shows 1 as SMS index in +CMTI response. 1 has to be extracted and AT+CMGR=1 command has to be formed and issued to read the SMS but it is sending AT+CMGR=4.
broken link removed
I think this is causing the problem.
There is a
AT+CMGD=1,4
OK
before +CMTI response and even though uartBuffer is cleared it is not getting cleared. So, Get_SMS_Index() is reading the 4 which is after the comma. Hence always it is AT+CMGR=4.
How to fix this ?
- - - Updated - - -
I modified the function like this but still it is sending AT+CMGR=4 when index is 1.
There is some problem. Earlier I connected SIM900 to PC and simulated using Proteus and it was working fine. I had not tested it in hardware. Now I am testing in hardware and both SIM900 and SIM800 gives the same result that SMS index is not being extracted properly. Don't know the problem. I have more than 1000 bytes free RAM.
What might be the problem ?
- - - Updated - - -
Problem solved. I had to add a 1 or 2 second delay like this.