ESP8266 keeps getting disconnected if Iphone app is open

Hello there,

No sure if this has been posted before, but as soon as I open my Iphone app, my ESP8266 serial port keeps getting disconnected. If the iphone app is closed, everything looks smooth and nice.
I am using the ESP8226 HUZZAH by AdaFruit.

Iphone 7+, iOS 10

Here is the code I am using. I attached a screenshot, too.

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include "SHT31.h" 
#include <SimpleTimer.h>
SHT31 sht31; 
char auth[] = "xxxxxxxxxxxxxxxxxxxxxx"; 
SimpleTimer timer;

void setup()
{ 
  Blynk.begin(auth, "xxxxxxxx", "vvvvvvvvv");  
  timer.setInterval(3000L, virtualPins);
  timer.setInterval(3000L, loop2);
  sht31.heater(true);
  sht31.reset();     
  Serial.begin(9600); 
  Wire.begin(4, 5); // Define I2C SDA & SCL pins.
  Serial.println("Humidity\t\  Temp \t\    DewPoint"); 
 
} 

void loop2()
{ 
float g;
Serial.print(sht31.getHumidity()); Serial.print(" %\t\t"); 
Serial.print(sht31.getTemperature_F()); Serial.print(" *F\t"); 
g = sht31.getDewPoint() * 1.8 + 32;  // Convert C DewPoint to F DewPoint
Serial.print(g); Serial.println(" *F\t"); 
}

void virtualPins()
{  
  sht31.begin();
  float DewP_F;  // Convert C DewPoint to F DewPoint
  DewP_F = sht31.getDewPoint() * 1.8 + 32;
  Blynk.virtualWrite(10, sht31.getTemperature_F());        
   Blynk.virtualWrite(11, sht31.getHumidity());             
   Blynk.virtualWrite(12, DewP_F);           
   Blynk.virtualWrite(13, sht31.getTemperature_F());        
   Blynk.virtualWrite(14, sht31.getHumidity());   
   
           
}

void loop()
{
  
 Blynk.run(); // Initiates Blynk
 timer.run(); // Initiates SimpleTimer
 }


Hello. Do you have reading widgets?

Yes, I do. I am using Value Display and History Graph connected to virtual pins 10 - 14.

I mean widget that have 'Frequency Reading" setting that is not in “PUSH” mode.

Dmitriy:

No sure if I understand your question. Here is more or less what I have done to stop getting disconnected, time out, log out, etc. It seems to me that if I add more than 5 Blynk.virtualWrite, I get that issue, 5 or less seem to work fine.

I mean such widgets - http://docs.blynk.cc/#blynk-main-operations-get-data-from-hardware-perform-requests-by-widget

Oh OK, Dmitriy, got it. I am using Frequency Reading rather than Push. Will this make a difference? As I said before,if I use more than 5 virtual pins, the serial port shows disconnected, log out, etc.

Yes. YOu need to check with PUSH mode only. This should fix issue.

Dmitriy:

Yes Sir, this fixed the issues, problem solved. You are the man.

Thank you for your time.