Seeed-Studio / GPRS_SIM900

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

sendSms #37

Closed Jonas-Meyer97 closed 5 years ago

Jonas-Meyer97 commented 5 years ago

Hi, I noticed that sendSms returns sometimes true even if its get a OK from the sim900 chip (i checked the serial). I tried to increase the timeout from 5 Seconds to 10 and for interchar from 3000 to 6000.It only happens when i send multiple sms. Any guess?

lanselambor commented 5 years ago

@Craftplorer I think there are two questions you asking.

  1. sendSMS returns true if only "OK" was read, even message was failed sending out. And "OK" may come from other commands.
  2. sendSMS may cause timeout by only set 5 seconds and 3 seconds for inter char?
Jonas-Meyer97 commented 5 years ago

Ok I checked again when i increase the interchar timeout for sim900_wait_for_resp to 6000 and timeout to something like 6-8 i it works reliable. I was just a bit confused because inside GPRS_Shield_Arduino.h the documentation for sendSMS is wrong.

    /** send text SMS
     *  @param  *number phone number which SMS will be send to
     *  @param  *data   message that will be send to
     *  @returns
     *      false on success
     *      true on error
     */
lanselambor commented 5 years ago

@Craftplorer Oops, the comment is truly wrong. And sure it's better to increase the timeout value, I will set it as 20 seconds.

Jonas-Meyer97 commented 5 years ago

@lanselambor Thank you.