Device goes offline for a short period of time


Scenario: I use my ESP8266 + temperature sensor DS18B20 to read current temperature and send to Blynk.

Problem: Device goes offline on average for 5 seconds every 2-4 hours.


My code:


BlynkTimer timer;

void temperatureEvent()
    float temp = sensors.getTempCByIndex(0);

    Blynk.virtualWrite(V4, temp);

void setup()
    // Debug console

    Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);

    timer.setInterval(60000L, temperatureEvent);

void loop()

What I have tried: so far for the last several months there was a default heartbeat value used, however, this offline message “spam” seemed a bit ridiculous so I increased this value to the one mentioned in the code, however, the problem is literally the same - device goes offline on average for about 5 seconds.

What I need: I would hope someone could point out what I could be missing so I would not be getting these fake offline message spams. Is there anything I could test out? Do I need to change my code? Thank you.

Your code looks okay, although it’s always better if you post the entire sketch and redact the sensitive information.

If you want to avoid the offline messages the in the web console go to Developer Zone > Templates > [the template for this device] > Edit > Template Settings > Offline Ignore Period

If you read the info on this it says…

Offline Ignore Period

Offline ignore period is an option that allows you to hide “offline” event on the device timeline. For example, let’s say you set the offline ignore period to 1 minute and we have the next device log:

17:44:33 - device connects 17:44:40 - device disconnects 17:44:50 - device connects again

With offline ignore period set to 1 minute your device timeline will show only 1 event:

17:44:33 device connects

This is because device reconnected within the 1 minute interval. Without offline ignore period set your timeline will show all the above events.

It would probably be better to figure-out what’s causing your device to go offline though. It could be poor WiFi signal (try reporting your RSSI to Blynk or the serial monitor), power supply, your WiFi/Modem/ISP, external interference or a faulty MCU.
Looking at your serial monitor and determining if the device is rebooting during these offline periods would be the first step.


1 Like

Thanks, @PeteKnight, I will try your suggestions. I hope this “Offline Ignore Period” will not only “hide “offline” event on the device timeline”, but also not send any notifications, since this is not mentioned, as far as I understand. Thanks again.