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:
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.
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.