-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TCPConnect timeout #1
Comments
You mean that with the original code, the SIM800 fails to connect the very first time but succeeds in subsequent retries?
|
Yes, i followed modem_client example. First time i power sim800 and
arduino, it fails; if i reset arduino (keeping sim800 powerd on), it sends
ok.
…On Tue, May 16, 2017 at 8:17 PM, Brian Ejike ***@***.***> wrote:
You mean that with the original code, the SIM800 fails to connect the very
first time but succeeds in subsequent retries?
Did you follow the modem_client example, by preceding TCPconnect() with
modem.setGPRSNetworkSettings(F("web.gprs.mtnnigeria.net"));
modem.enableGPRS(true);
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGfc8vebpI_ZBpl3sE2UQSahK_ZS7OqHks5r6fZPgaJpZM4NcnRe>
.
|
Well, after playing around with your code i notice that you are not checking for success on modem.enableGPRS(), so i did this:
|
The default timeout period was good enough for me and this issue never came up. If it worked for you though, perhaps I'll edit the example. |
I think I'll leave out the check since looking through the method's code now, the timeout for each command sent is at least 10s, more than enough in most cases to get the job done and the whole point of encapsulating the commands+reasonable timeouts under one method is to prevent this kind of check from popping up everywhere in application code. Yours is a special case, I think, and I'll leave it up to the user to insert checks as necessary, like you did. It's only an example after all. |
Hi
First time i connect SIM800 it fails sending message, because SIM800 needs time to settle and open TCP connection. The folowing times it connects ok.
I tried add a timeout on the SIM800.CPP TCPConnect() function at:
but after that it always fails.
Can you help?
Regards
The text was updated successfully, but these errors were encountered: