Seeed-Studio / GPRS_SIM900

library for GPRS shield with sim900 module.
MIT License
138 stars 96 forks source link

can't read sms sim800l #19

Closed beryindo closed 5 years ago

beryindo commented 6 years ago

can't read sms sim800l. this support ussd?

ortegafernando commented 6 years ago

Hi, I have reopened it because I have a mistake in the library isSMSunread function.

Both sendSMS and readSMS configure SMS to text mode.

AT+CMGF=1

And after that, they send AT commands to send, read or whatever.

isSMSunread doesn't. It will have to send AT+CMGF=1 and wait 1000 miliseconds, and after that, call to AT+CMGL="REC UNREAD",1

We could also configure always AT+CMGF=1 inside init function. (or you could also configure it forever (SIM900/SIM800 eeprom) by AT+CMGF=1 plus AT&W

PLEASE, TELL ME IF YOU PREFER AT+CMGF in the init function, or in each other individual functions. (I prefer in init function, so we dont need to wait always 1000 miliseconds in the other functions)

I have a much more developed SIM900 library, wait a few days for a big update.

Thanks.

ortegafernando commented 6 years ago

@lanselambor Please, tell me your opinion, Do you prefer also in the INIT function ?

ortegafernando commented 6 years ago

@KillingJacky Also, Jack, please tell me your opinion. Thanks

lanselambor commented 6 years ago

@ortegafernando I agree that AT+CMGF=1 should move to INIT function.

ortegafernando commented 6 years ago

I have added a new pull request https://github.com/Seeed-Studio/GPRS_SIM900/pull/31 (NOTE: I have deleted hardware serial support, see notes)