-->
Page 1 of 1

Gsender success fail

PostPosted: Fri May 18, 2018 2:24 pm
by liderbug
Job: Mailbox is opened, switch closes, esp8266 fires up, connects to router, gsender sends "you have mail" to phone, power off.

Google has been no help at all (or I'm asking the wrong question)
So, 80% of the time my code works fine and I get my SMS. However the other 20% I don't.

<setup, connect to router...>
gsender->Send("7890123456@vtext.com", mytxt);
<now I want to check if the message went, if not then try 2 more times before giving up. I've looked for a solution - :(
I'm guessing it's gsender->_error (but what?
Thanks

Re: Gsender success fail

PostPosted: Fri May 25, 2018 7:30 am
by liderbug
Figured it out. Going through the gsender.cpp code it returns 0 or 1. So I coded up 3 strikes. So if my text msg says "You have smail 1 2" it failed twice before it went through.

[code]
while ( ! gsender->Send("7191234567@atext.com", msg))
{
sprintf (msg, "%s %d", msg, n);
//Serial.println (msg);
delay (1000);
n++;
//Serial.println (n);
if (n>3)
break;
}
[\code]