-
Notifications
You must be signed in to change notification settings - Fork 32
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
Hangup of the Logging when Internet connection is shortly interrupted #7
Comments
Process2 on ebay sells a watchdog timer kit for around 10 dollars.
…On Tue, Sep 6, 2022 at 11:02 AM kipet1 ***@***.***> wrote:
HI,
my logging goes in hangup occasionally (1-2 times /week), this is boring.
The Wemos gets stuck exactly during
if(client->POST(url, host, payload)){
It happens, when exactly during post the internet gets disconnected for a
short while. My router makes each day a reconnect with interruption of
connection to get a new IP. It is not so rare, that this is falling just
into the post procedure, as this takes about 3 seconds, each 15seconds.
Before the post i get the info "Publishing ...", then nothing happens
anymore, it stays forever, no return of Success or error message.
I need to reset the Wemos to restart.
Does anybody have an idea of rootcause and/or countermeasure?
This is my code of that part, like in your example:
// Publish data to Google Sheets
int retval = client->connect(host, httpsPort);
Serial.print("Client: ");Serial.println(retval);
Serial.println(WiFi.status());
Serial.println("Publishing...");
//Serial.println(payload);
if(client->POST(url, host, payload)){
Serial.println("successful");
}
else{
// do stuff here if publish was not successful
Serial.println("Error while connecting");
}
—
Reply to this email directly, view it on GitHub
<#7>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWXSN5GAGT6CWVBY6R4XOLV45MJTANCNFSM6AAAAAAQF5MEO4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I was assuming, something could be done inside the google script, but it is no more in the loop, when the hangup occurs. |
good job. good to hear!
…On Fri, Sep 9, 2022 at 9:16 AM kipet1 ***@***.***> wrote:
I was assuming, something could be done inside the google script, but it
is no more in the loop, when the hangup occurs.
Your watchdog suggestion brought me to the solution.
The ESP8266 has a SW and HW watchdog on board, but they have strong
limitations and do not work straightforward.
I disabled the SW watchdog with
ESP.wdtDisable(); //SW WD disable, only HW
And reset (feed) the HW WD every loop round and before the POST request.
ESP.wdtFeed();
This pulls it out from hangup after about 8sec.
I was not sure, if this works, but it solves the issue.
Thanks, regards Peter
—
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWXSN2IXEQC2BJRLSD474DV5M2EDANCNFSM6AAAAAAQF5MEO4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hi, |
Get an external WDT. Process2 on ebay. Like 10 bucks including shipping.
Good luck.
…On Wed, Sep 14, 2022, 12:44 PM kipet1 ***@***.***> wrote:
Hi,
unfortunately it turned out, that the solution with the WD is not working
reliably. Testing it at the beginning 2 times by manually interrupting the
DSL, it worked perfect, and i was happy. But it turns out, that it gets
still locked sometimes at the POST request.
I do not yet have any clue, why the watchdog is not biting reliable, still
searching for a solution.
In the moment, the internet gets short interruptions several times during
the night, maybe some maintenence. Every night i got one hangup.
—
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWXSN3GDTE3KE6JLPELI23V6H6FDANCNFSM6AAAAAAQF5MEO4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hi rret, |
see here: https://process2.net/
also here: https://www.ebay.com/itm/144707052822
Your code basically sends a heartbeat to the WDT. If the WDT doesn't get a
HB, it sets a pin on the WDT to low, which you can use to reset your
microprocessor.
Hope that helps. Let me know if any questions. Thank you.
…On Thu, Sep 22, 2022 at 6:31 AM kipet1 ***@***.***> wrote:
Hi rret,
as this issue is still pending, and also the electronicguy for the
httpsdirect library does not answer, please give me some more info about
your recommended WDT.
The price is not the big issue, but the work to add it into my device
inside the case.
I cannot find such a thing on ebay. I only find a 3 pin device DS1233,
which supervises the supply as watchdog, not really suitable. Thanks, Peter
—
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWXSNYVAIYZOUWZHXPBJFTV7QYQBANCNFSM6AAAAAAQF5MEO4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Thanks for your information. |
good luck!
…On Thu, Sep 22, 2022 at 3:42 PM kipet1 ***@***.***> wrote:
Thanks for your information.
I couldn't find it, because process2 does not sell to germany.
Also the circuit looks not really smart, with a huge cap.
I have the idea now, to put a second Wemos 8266 on top of it, the pins are
then compatible, they superwise each other.
It sounds like an overkill, but this is much cheaper, fully programmable,
and smaller.
—
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWXSN5A75OD56RFYGAS2ODV7SZAXANCNFSM6AAAAAAQF5MEO4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
As you have mentioned that after **if(client->POST(url, host, payload)) , My suggestion : // Clear the input stream of any junk data before making the request while(available())
while (connected()) { In case of connectivity issue you can change these above while loops with for loop by setting some time limit and you can come out of that loop and do the next acitivity from your algorithm. just try it out and let us know |
Thanks for your hints, |
HI,
my logging goes in hangup occasionally (1-2 times /week), this is boring.
The Wemos gets stuck exactly during
if(client->POST(url, host, payload)){
It happens, when exactly during post the internet gets disconnected for a short while. My router makes each day a reconnect with interruption of connection to get a new IP. It is not so rare, that this is falling just into the post procedure, as this takes about 3 seconds, each 15seconds.
Before the post i get the info "Publishing ...", then nothing happens anymore, it stays forever, no return of Success or error message. (Before post Wifi and client was connected)
I need to reset the Wemos to restart.
Does anybody have an idea of rootcause and/or countermeasure?
This is my code of that part, like in your example:
// Publish data to Google Sheets
int retval = client->connect(host, httpsPort);
Serial.print("Client: ");Serial.println(retval);
Serial.println(WiFi.status());
Serial.println("Publishing...");
//Serial.println(payload);
if(client->POST(url, host, payload)){
Serial.println("successful");
}
else{
// do stuff here if publish was not successful
Serial.println("Error while connecting");
}
The text was updated successfully, but these errors were encountered: