Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By alf
#57547 Hi,
I am using GET on a webserver to upload some data every 20 seconds. For some reason it randomly won't connect (even though wifi remains connected, i can ping the module). I have the module about 1metre away from the modem, so signal strength is good. I have turned on debug, and it comes up with :err -8 (what does this mean? Where can i find the documentation for the debug?)
I have tried another wifi and internet connection, same problem. Sometimes it goes for 1 hour then the problems start, other times it goes for 5-10 minutes then the problems start. It's very random.

Here is the sample code (it's in a function that is called every 20 seconds):

Code: Select all 
WiFiClient client;

  if (client.connect(server_ip_address,80))
  {
    String text_to_send = "GET http://mywebsiteURL.com/index.php?uptime_ms=";
    text_to_send +=millis();
    text_to_send +="&heap=";
    text_to_send +=ESP.getFreeHeap();
    text_to_send +="&RSSI=";
    text_to_send +=WiFi.RSSI();
    text_to_send +=" HTTP/1.1\r\nHost: mywebsiteURL.com\r\nConnection: close\r\n\r\n";

    client.print(text_to_send);
   
  }
  else
  {
    DEBUG_MSG("ERROR CONNECTING - Wifi Status %d\n", WiFi.status());
  }
  client.stop();

DEBUG_MSG("Wifi Status %d\n", WiFi.status());



When it works fine, it displays the following output:

:ref 1
:wr
:sent 131
:ww
:rn 1452
:rch 1452, 598
:rcl
:abort
:ur 1
:del
Wifi Status 3

When it fails, it displays the following:
:err -8
ERROR CONNECTING - Wifi Status 3
Wifi Status 3

Where can I find more about what :err -8 is or means?
User avatar
By alf
#57635 Well this is strange, I tried the same code on an ESP-01 (the errors above were on an ESP-12) and it runs flawlessly for the last 24 hours, not a single missed packet! So all is well. Anyways, i would still like to know what the :err -8 means and where i can go about finding details in how the read the debugging. Thanks guys.