Help! Blynk stuck after wifi resets

I have a section of code that I’ve been using for months, but periodically my wifi will drop or my device is slightly out of range and loses connection. Once this happens, the Blynk connection is not able to re-establish after wifi is reconnected (I’m assuming the device reconnects to wifi automatically or via code). I’ve searched and tried multiple methods listed here as solutions, but my device seems to get stuck. I’ve completely oversimplified my code to what is listed below to remove any possible variability in the rest of my original project.

Arduino Uno Wifi Rev 2
Andriod
Blynk server


#define BLYNK_PRINT Serial
#define BLYNK_DEBUG



#include <SPI.h>;
#include <WiFiNINA.h>;
#include <BlynkSimpleWiFiNINA.h>;


char auth[] = "********************";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "**************";
char pass[] = "*****************";


BlynkTimer timer;



void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
}






void setup()
{

  // Debug console
  Serial.begin(9600);
  Blynk.config(auth);
  Blynk.connectWiFi(ssid, pass);

  timer.setInterval(30000L, reconnectBlynk);



}

void reconnectBlynk()
{
  if (!Blynk.connected())
  {
    Serial.println("Lost connection");
    if (Blynk.connect()) Serial.println("Reconnected");
    else Serial.println("Not reconnected");
  }
  else if (Blynk.connected())
  {
    Serial.println("Connected");
  }
}


void loop()
{  
  timer.run(); // Initiates BlynkTimer

    if (Blynk.connected()) {Blynk.run();}
    Blynk.run();                                    // Starts Blynk connection
}

This is my output. As you can see, it is stuck trying to connect to the Blynk cloud after wifi is lost.

Connected
[403613] <[06|00|19|00|00]
[406615] <[06|00|1A|00|00]
[409616] <[06|00|1B|00|00]
[412617] <[06|00|1C|00|00]
[412709] Heartbeat timeout: 412709, 393708, 412616
[417617] Connecting to blynk-cloud.com:80
Lost connection
[427620] Connecting to blynk-cloud.com:80
Not reconnected
[437624] Connecting to blynk-cloud.com:80
[447627] Connecting to blynk-cloud.com:80
Lost connection
[457630] Connecting to blynk-cloud.com:80
Not reconnected
[467634] Connecting to blynk-cloud.com:80
[477637] Connecting to blynk-cloud.com:80
Lost connection
[487640] Connecting to blynk-cloud.com:80
Not reconnected
[497643] Connecting to blynk-cloud.com:80
[507648] Connecting to blynk-cloud.com:80
Lost connection
[517651] Connecting to blynk-cloud.com:80
Not reconnected
[527654] Connecting to blynk-cloud.com:80
[537657] Connecting to blynk-cloud.com:80
Lost connection
[547661] Connecting to blynk-cloud.com:80
Not reconnected
[557664] Connecting to blynk-cloud.com:80
[567668] Connecting to blynk-cloud.com:80

My current “working” code does not have a reconnect function, because once I’m stuck in the “Connecting to blynk-cloud” loop, the remaining code won’t continue to run. And I need to code to run and perform it’s normal function when the wifi is lost. But ideally, once wifi is re-established, everything will reconnect and I can access the function in the Blynk app.

Please help!!!

Thanks.
Shane

First of all, I don’t use the same hardware as you, so these comments are based on my experiences with ESP8266 or ESP32 devices, which don’t use the WiFiNINA library.

My preference is to avoid using Blynk.connectWiFi and instead manage the WiFi connection yourself.

The outline of the process I’d use are…

Attempt to connect to WiFi.
If connected to WiFi then attempt to Blynk.
Use a timer to check if WiFi is still connected - if it isn’t then run the WiFi connect routine again.

If you want to run other code if a WiFi/Blynk connection can’t be established then limit the WiFi connection attempts using a counter, and add a timeout to the Blynk.connect() command.

Pete.

Hey Pete. I was hoping I could get some input from you as most of the searching I did had you’re responses. Do you have an example of the function that is used to connect to Blynk without the wifi connection occurring at the same time? Seems like Blynk.begin and Blynk.connectWiFi are both performing that function, I had hoped that by breaking out the Blynk.config portion (instead of Blynk.begin) would help, but not the case. Also, I’m having a lot of difficulty getting the Blynk loop to stop once it tries to “connect to blynk-cloud”. I think if I could force that loop to stop, then the rest of the solutions out there would work. But once in that loop, I’m not really able to try any other Blynk commands besides checking blynk.connect (at least that’s how it seems).

No, not using the WiFiNINA library.

Not exactly. Blynk.begin is a 100% blocking function. Blynk.connect is not. You should probably read this…

Hence my suggestion to manually manage the WiFi connection, then the Blynk connection with a timeout.

Pete.

This is definitely a start, but adding this WiFi.begin line does reconnect the Wifi as expected (resulting in everything working as expected). Thanks for the advice Pete

void reconnectBlynk()
{
  if (!Blynk.connected())
  {
    Serial.println("Lost connection");
    Blynk.disconnect();
    WiFi.begin(ssid, pass);
    Blynk.connect();
    if (Blynk.connect()) Serial.println("Reconnected");
    else Serial.println("Not reconnected");
  }
  else if (Blynk.connected())
  {
    Serial.println("Connected");
  }
}

That’s not really the approach I was suggesting. I’ve just googled the WiFiNINA library methods and they seem to be the same as those for the ESP8266…

Calling WiFi.begin(ssid, pass); just once won’t normally result in a connection. The normal method is to put the WiFi.begin() command in a while loop, which causes the code to wait until a WiFi connection has been established before the code can exit the while loop. However, this isn’t a good approach if you want to be able to use the device in offline mode, say with a physical switch that can turn a relay on/off regardless of whether the device is connected to WiFi and Blynk.
The code in the link above uses this while loop approach.

This is how I limit the number of WiFi connection attempts (uin this case to 20, as defined by the max_wifi_connect_attempts=20; line of code…

bool standalone_mode = true;

void Connect_to_WiFi()
{
   wifi_attempt_count=0;
   max_wifi_connect_attempts=20;
   wait_between_wifi_attempts_millis=500; 
  
  Serial.println(F("Connecting to WiFi..."));
  if (WiFi.status() != WL_CONNECTED)
  {
      WiFi.begin(ssid, pass); // connect to the network
  }

  while (WiFi.status() != WL_CONNECTED  && wifi_attempt_count < max_wifi_connect_attempts) // Loop until we've connected, or reached the maximum number of attemps allowed
  {
    delay(wait_between_wifi_attempts_millis);
    wifi_attempt_count++;   
    Serial.print(F("WiFi connection - attempt # "));
    Serial.print(wifi_attempt_count);
    Serial.print(F(" of "));
    Serial.println(max_wifi_connect_attempts);       
  }

  // we get to this point when either we're connected to Wi-Fi, or we've tried too many times. We need to do differnet things, depending which it is...
  if (WiFi.status() == WL_CONNECTED)
  {
    WiFi.mode(WIFI_STA);
    Serial.println(F("WiFi CONNECTED"));
    Serial.println();
  }
  else
  {  
    // we get here if we tried multiple times, but can't connect to WiFi. We need to go into stand-alone mode and wait a while before re-trying...
    standalone_mode = true;                     // We can't be in connected mode if no wifi
    Serial.println();
    Serial.println(F("................ In Stand-alone mode ................"));
  }
}

The other issue with your approach is that you are just checking if you have a connection to Blynk…

If you want to operate in stand-alone mode then you need to be doing a check to see if you are connected to WiFi. If you aren’t then you need to try to re-connect.
If you are connected to WiFi but not to Blynk (the Blynk server is down) then each time Blynk.run is encountered the code will attempt to re-connect to Blynk, which will disrupt your stand-alone operation.

Pete.

1 Like

Hi again Pete,

I’ve been reading more into your solution you’ve provided above and trying to understand how I can incorporate it into my project.

I think with the code you added above, I can get it to work the way you’ve suggested. I may add an additional counter to reset the max_wifi_connect_attempts so the device will try to reconnect at a later date/time.

For standalone_mode, is this all done in the void loop (with a check if bool is true) with calls to the same functions that the blynk.timer calls in the void setup? I’m assuming that the blynk.timer function doesn’t work if there is no connection to blynk? If not, how are you using the bool to keep the needed functions running when wifi can’t be established?

Thanks again.

I don’t really understand the question, but this is all too hypothetical without undemanding more about what you are trying to achieve in your particular case.

Incorrect. BlynkTimer does not require a Blynk connection.

Pete.

OK, I think your answer to the second question answers the first question. So, the issue is that the Blynk.run function is blocking (or somewhat blocking) the standalone to continue. I currently call these functions in the setup loop:

timer.setInterval(1000L, checkLevels);
timer.setInterval(5000L, Mix2FinalSet);
timer.setInterval(5000L, RODI2MixSet);
timer.setInterval(5000L, EmergencyStop);
timer.setInterval(300000L, reconnectBlynk);
timer.setInterval(21600000L, FillFinalBin);

And based on what I understand, these will still run on the timer regardless if Blynk is connected. I just need to make sure that I follow the steps you laid out before.
Check for wifi connection
If no wifi connection then reconnect wifi
If connected to wifi then attempt to connect blynk
If connected to Blynk, then blynk.run

Is that right, I’m questioning this last “if” statement? Assuming it looks like this:
if (Blynk.connected())
{Blynk.run();}

This way I would never connect to blynk if I have lost wifi and I could still run all my timer.setinterval functions.

Thanks.

You could do it like that, or check standalone_mode

You should read the “Staggering Timers” section of this tutorial…

Pete.

I’m having an issue now that I lose the Blynk connection and it is not re-established. I’m not sure how to troubleshoot this one as this seems to be part of the Blynk library outputs in the serial monitor.

This is the serial monitor output I’m getting:

[2337649] Heartbeat timeout
[2339652] Connecting to blynk-cloud.com:80

I then get a repeating ouptut “connecting to blynk-cloud”. Any ideas?

For the sections of code that I’m using to re-establish my connections, etc

void Connect_to_WiFi()
{
 
  
  Serial.println(F("Connecting to WiFi..."));
  if (WiFi.status() != WL_CONNECTED)
  {
      WiFi.begin(ssid, pass); // connect to the network
  }

  while (WiFi.status() != WL_CONNECTED  && wifi_attempt_count < max_wifi_connect_attempts) // Loop until we've connected, or reached the maximum number of attemps allowed
  {
    delay(wait_between_wifi_attempts_millis);
    wifi_attempt_count++;   
    Serial.print(F("WiFi connection - attempt # "));
    Serial.print(wifi_attempt_count);
    Serial.print(F(" of "));
    Serial.println(max_wifi_connect_attempts);       
    
  }

  // we get to this point when either we're connected to Wi-Fi, or we've tried too many times. We need to do differnet things, depending which it is...
 
  if (WiFi.status() == WL_CONNECTED)
  {
    //WiFi.mode(WIFI_STA);
    Serial.println(F("WiFi CONNECTED"));
    Serial.println();
  }
  else
  {  
    // we get here if we tried multiple times, but can't connect to WiFi. We need to go into stand-alone mode and wait a while before re-trying...
    standalone_mode = true;                     // We can't be in connected mode if no wifi
    Serial.println();
    Serial.println(F("................ In Stand-alone mode ................"));
    timer.setInterval(1000*60*60,delayedWIFIconnect);
  }
}
void delayedWIFIconnect()
{
  if (standalone_mode = true)
  {
    wifi_attempt_count=0;
  }
}
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Connect_to_WiFi();
  Blynk.config(auth);
  Blynk.connect();
  timer.setInterval(1000L, checkLevels);
  timer.setInterval(5000L, Mix2FinalSet);
  timer.setInterval(5000L, RODI2MixSet);
  timer.setInterval(5000L, EmergencyStop);
  timer.setInterval(5000L, FillFinalBin);
  pinMode(MIXswitchHIGH, INPUT_PULLUP);
  pinMode(MIXswitchLOW, INPUT_PULLUP);
  pinMode(FINALswitchHIGH, INPUT_PULLUP);
  pinMode(FINALswitchLOW, INPUT_PULLUP);
  pinMode(RODI2MIXrelay, OUTPUT);
  pinMode(MIX2FINALrelay, OUTPUT);
  pinMode(FINALswitchEM, INPUT_PULLUP);
  pinMode(MIXswitchEM, INPUT_PULLUP);
  
}

void loop() {
  timer.run();
  if (WiFi.status() != WL_CONNECTED)
  {
    Connect_to_WiFi();
    
  }
  if (WiFi.status() == WL_CONNECTED)
  {
    if (!Blynk.connected())
    {
      Blynk.connect();
    }
  }
  if (Blynk.connected()) 
  {
    Blynk.run();
  }
  //Blynk.run();

}

I’d say that these two are connected.

Pete.

Meaning I’m doing too many things at the same time interval? All my sketches are doing this with other projects, and the same basic re-connect code. I’ll switch the time intervals to occur at different points and test.

I saw one thread that mentioned using the Serial.print while also attempting to use the #define BLYNK_PRINT Serial could also be an issue. Any thoughts?

Which thread was that?

Pete.

I realize they are discussing the D1 mini and ESP01, but at least similar connection issues.

Not relevant to your situation.

Pete.

Is there a way to determine the cause of a wifi connection being lost? I haven’t put anything into my code currently that will detect when it drops, besides that I know the hour when it connects and can check the serial monitor to determine how many times it will reconnect to my wifi and Blynk.

This issue has been plaguing me for some while, and although I can now establish connection after it’s lost, it seems to be lost every minute. Meaning I’m not getting good functionality with time based operations within the code.

Thanks again.

//#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG
#include <Wire.h>
#include <SPI.h>;
#include <WiFiNINA.h>;
#include <BlynkSimpleWiFiNINA.h>;
#include <OneWire.h>
#include <TimeLib.h>
#include <WidgetRTC.h>
#define MIXswitchHIGH 2
#define MIXswitchLOW 3
#define FINALswitchHIGH 4
#define FINALswitchLOW 5
#define RODI2MIXrelay 6
#define MIX2FINALrelay 7
#define MIXswitchEM 8
#define FINALswitchEM 9

int MixLevelHigh = 0;
int FinalLevelHigh = 0;
int MixLevelLow = 0;
int FinalLevelLow = 0;
int MixEmergency = 0;
int FinalEmergency = 0;
int pinValue1 = 0;
int pinValue2 = 0;
int pinValue3 = 0;
int wifi_attempt_count=0;
int max_wifi_connect_attempts=20;
int wait_between_wifi_attempts_millis=500;

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "************************";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "**************";
char pass[] = "*****************";

//Both used for Blynk
BlynkTimer timer;
WidgetRTC rtc;
WidgetLED led1(V5);
WidgetLED led2(V6);

BLYNK_CONNECTED()
{
  rtc.begin();
  //Blynk.syncVirtual(V11);
}

void RODIpumpRUN()
{
  digitalWrite (RODI2MIXrelay,HIGH);
}

void RODIpumpIDLE()
{
  digitalWrite (RODI2MIXrelay,LOW);
}

void MIXpumpRUN()
{
  digitalWrite (MIX2FINALrelay,HIGH);
}

void MIXpumpIDLE()
{
  digitalWrite (MIX2FINALrelay,LOW);
}

void checkLevels()
{
  MixLevelHigh = digitalRead(MIXswitchHIGH);
  MixLevelLow = digitalRead(MIXswitchLOW);
  FinalLevelHigh = digitalRead(FINALswitchHIGH);
  FinalLevelLow = digitalRead(FINALswitchLOW);
  FinalEmergency = digitalRead(FINALswitchEM);
  MixEmergency = digitalRead(MIXswitchEM);
  //Serial.print("Low level mix: ");
  //Serial.println(MixLevelLow);
  //Serial.print("High level mix: ");
  //Serial.println(MixLevelHigh);
  //Serial.print("Emergency level mix: ");
  //Serial.println(MixEmergency);
  //Serial.print("Low level final: ");
  //Serial.println(FinalLevelLow);
  //Serial.print("High level final: ");
  //Serial.println(FinalLevelHigh);
  //Serial.print("Emergency level final: ");
  //Serial.println(FinalEmergency);
  
  if (MixLevelLow == HIGH)
  {
    if (MixLevelHigh == LOW)
    {
      led1.on();
      Blynk.setProperty(V5, "color", "#1af002");
    }
  }
  if (MixLevelLow == LOW)
  {
    led1.on();
    Blynk.setProperty(V5, "color", "#f81605");
  }
  if (MixEmergency == HIGH)
  {
    led1.on();
    Blynk.setProperty(V5, "color", "#f81605");
  }
  
  if (FinalLevelLow == HIGH)
  {
    if (FinalLevelHigh == LOW)
    {
      led2.on();
      Blynk.setProperty(V6, "color", "#1af002");
    }
  }
  if (FinalLevelLow == LOW)
  {
    led2.on();
    Blynk.setProperty(V6, "color", "#f81605");
  }
  if (FinalEmergency == HIGH)
  {
    led2.on();
    Blynk.setProperty(V6, "color", "#f81605");
  }
}

BLYNK_WRITE(V1)
{
  pinValue1 = param.asInt();
  Serial.println("Fill Mix Bin");
}



void RODI2MixSet()
{
  //Serial.print("High level switch: ");
  //Serial.println(MixLevelHigh);
  //Serial.println(pinValue1);
    if (MixLevelHigh == HIGH)
    {
      RODIpumpIDLE();
      //pinValue1 = 0;
      Blynk.virtualWrite(V1,0);
      pinValue1 = 0;
      Serial.println("Mix bin is already full, cannot proceed.");
      //Blynk.virtualWrite(V4, "Mix bin full");
    }
    if (MixLevelHigh == LOW & pinValue1 == 1)
    {
      RODIpumpRUN();
      Serial.println("Filling mix bin with RODI water");
      Blynk.virtualWrite(V4, "Filling mix bin");
    }
    if (MixLevelHigh == LOW & pinValue1 == 0)
    {
      RODIpumpIDLE();
      Serial.println("RODI to mix pump idle");
    }
}

BLYNK_WRITE(V2)
{
  pinValue2 = param.asInt();
  Serial.println("Fill Final Bin");
}

void Mix2FinalSet()
{
    
    if (MixLevelLow == LOW)
    {
      MIXpumpIDLE();
      Blynk.virtualWrite(V2,0);
      pinValue2 = 0;
      Serial.println("Mix bin is too low to proceed.");
      Blynk.virtualWrite(V4,"Mix Bin Low");
      Blynk.email("********************@gmail.com", "Mix Bin Low");
    }
    if (FinalLevelHigh == HIGH)
    {
      MIXpumpIDLE();
      Blynk.virtualWrite(V2,0);
      pinValue2 = 0;
      Serial.println("Final bin is already full, cannot proceed.");
      //Blynk.virtualWrite(V4, "Final bin full");
    }  
    if (FinalLevelHigh == LOW & pinValue2 == 1)
    {
      MIXpumpRUN();
      Serial.println("Filling final bin with saltwater");
      Blynk.virtualWrite(V4, "Filling final bin");
    }
    if (FinalLevelHigh == LOW & pinValue2 == 0)
    {
      MIXpumpIDLE();
      Serial.println("Mix to final pump idle");
    }
   
}

void FillFinalBin()
{
    
    if (FinalLevelLow == LOW)
    {
      Serial.println("Final bin is too low.");
      Blynk.virtualWrite(V4,"Final Bin Low");
      Blynk.email("******************@gmail.com", "Final Bin Low");
    }
}

BLYNK_WRITE(V3)
{
  pinValue3 = param.asInt();
  Serial.println("Emergency Shut off");
  Blynk.virtualWrite(V4, "Emergency STOP");
}

void EmergencyStop()
{
    if (pinValue3 == 1)
    {
      MIXpumpIDLE();
      RODIpumpIDLE();
      Blynk.virtualWrite(V1,0);
      pinValue1 = 0;
      Blynk.virtualWrite(V2,0);
      pinValue2 = 0;
      Serial.println("All pumps stopped");
    }
    if (FinalEmergency == HIGH)
    {
      //MIXpumpIDLE();
      RODIpumpIDLE();
      //Blynk.virtualWrite(V1,0);
      //pinValue1 = 0;
      Blynk.virtualWrite(V2,0);
      pinValue2 = 0;
      Serial.println("Final bin emergency high level stop");
    }
    if (MixEmergency == HIGH)
    {
      MIXpumpIDLE();
      //RODIpumpIDLE();
      Blynk.virtualWrite(V1,0);
      pinValue1 = 0;
      //Blynk.virtualWrite(V2,0);
      //pinValue2 = 0;
      Serial.println("Mix bin emergency high level stop");
    }
    if (pinValue3 == 0)
    {
      Blynk.virtualWrite(V4,"Status normal");
    }
}

bool standalone_mode = true;

void Connect_to_WiFi()
{
 
  
  Serial.println(F("Connecting to WiFi..."));
  if (WiFi.status() != WL_CONNECTED)
  {
      WiFi.begin(ssid, pass); // connect to the network
  }

  while (WiFi.status() != WL_CONNECTED  && wifi_attempt_count < max_wifi_connect_attempts) // Loop until we've connected, or reached the maximum number of attemps allowed
  {
    delay(wait_between_wifi_attempts_millis);
    wifi_attempt_count++;   
    Serial.print(F("WiFi connection - attempt # "));
    Serial.print(wifi_attempt_count);
    Serial.print(F(" of "));
    Serial.println(max_wifi_connect_attempts);       
    
  }

  // we get to this point when either we're connected to Wi-Fi, or we've tried too many times. We need to do differnet things, depending which it is...
 
  if (WiFi.status() == WL_CONNECTED)
  {
    //WiFi.mode(WIFI_STA);
    Serial.println(F("WiFi CONNECTED"));
    Serial.println();
  }
  else
  {  
    // we get here if we tried multiple times, but can't connect to WiFi. We need to go into stand-alone mode and wait a while before re-trying...
    standalone_mode = true;                     // We can't be in connected mode if no wifi
    Serial.println();
    Serial.println(F("................ In Stand-alone mode ................"));
    timer.setInterval(1000*60*60,delayedWIFIconnect);
  }
}

void delayedWIFIconnect()
{
  if (standalone_mode = true)
  {
    wifi_attempt_count=0;
    Connect_to_WiFi();
  }
}

//void reconnectBlynk()
//{
//  if (!Blynk.connected())
//  {
//    Serial.println("Lost connection");
//    Blynk.disconnect();
//    WiFi.begin(ssid, pass);
//    Blynk.connect();
//    if (Blynk.connect()) Serial.println("Reconnected");
//    else Serial.println("Not reconnected");
//  }
//  else if (Blynk.connected())
//  {
//    Serial.println("Connected");
//  }
//}


void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Connect_to_WiFi();
  Blynk.config(auth);
  Blynk.connect();
  timer.setInterval(1000L, checkLevels);
  timer.setInterval(5000L, Mix2FinalSet);
  timer.setInterval(6000L, RODI2MixSet);
  timer.setInterval(7000L, EmergencyStop);
  //timer.setInterval(300000L, reconnectBlynk);
  timer.setInterval(8000L, FillFinalBin);
  pinMode(MIXswitchHIGH, INPUT_PULLUP);
  pinMode(MIXswitchLOW, INPUT_PULLUP);
  pinMode(FINALswitchHIGH, INPUT_PULLUP);
  pinMode(FINALswitchLOW, INPUT_PULLUP);
  pinMode(RODI2MIXrelay, OUTPUT);
  pinMode(MIX2FINALrelay, OUTPUT);
  pinMode(FINALswitchEM, INPUT_PULLUP);
  pinMode(MIXswitchEM, INPUT_PULLUP);
  
}

void loop() {
  timer.run();
  if (WiFi.status() != WL_CONNECTED)
  {
    Connect_to_WiFi();
    
  }
  if (WiFi.status() == WL_CONNECTED)
  {
    if (!Blynk.connected())
    {
      Blynk.connect();
    }
  }
  if (Blynk.connected()) 
  {
    Blynk.run();
  }
  //Blynk.run();

}
[5312] Connecting to blynk-cloud.com:80
[5470] Ready (ping: 74ms).
[5669] Time sync: OK
Hour: 14
Deep sleep pin value: 0
Deep sleep mode
[75] Connecting to *************
[7307] Connected to WiFi
[7307] IP: 192.168.4.143
[7307]

[5311] Connecting to blynk-cloud.com:80
[5479] Ready (ping: 68ms).
[5698] Time sync: OK
Hour: 14
Deep sleep pin value: 0
Deep sleep mode
[75] Connecting to **************
[5306] Connected to WiFi
[5307] IP: 192.168.4.143
[5307] 

I’m assuming the number in the brackets have some meaning, and could potentially tell me how many times I’m losing connection. These two outputs are not back-to-back, just two separate instances I copied.

Where are these messages coming from?

Pete.