Device lost in application

Enable Serial Monitor if you continue to have problems. I’ll move this thread to the help section for now.

Serial was enabled. And there were no messages there. Actually, I can’t spend 24 hours near the serial port monitor waiting for device disconnect. Maybe, it’s better to move back to Home Assistant, as those phantom disconnections in Blynk are quite annoying.

You don’t have to watch SM for 24 hours but if you seriously think HA is better then by all means switch back to it.

Your main problem is that you don’t seem to know very much about the hardware and software you are using.

We were trying to help you get a better understanding of what you don’t know.

I wouldn’t use the word often.

That’s a fair comment, but it does happen from time to time and can catch you out if you’re not looking out for it.
I find that if I just set the machine so that it never sleeps and don’t use it for anything else then the serial monitor is fairly reliable. The problems seem to occur when I’m doing other stuff with the serial monitor running in the background.

Pete.

1 Like

I know quite good how the hardware works, as I started my life with MCUs a long time ago with pic and avr asm. But you are comptetely right about the sw. I don’t know, how the Blynk framework works, I don’t know what does it do on the background… The HA was much more clear for me, as It uses MQTT and I’ve never had such problems with connections. But it has its own disadvantages. I like Blynk and appreciate your hel, but, unfortunately, nobody can answer me what may lead ti such behavior.
The more of disconnections I usually have in the evening - each 10 minutes. I’ll try to monitor it more carefully this evening and will provide some details if have some.

Thanks to everybody for your replies.

But you were not aware of the WDT’s on the ESP. For ESP’s there are 2, and enabled by default, unlike the AVR’s where you have to enable the WDT. They are known as a hardware and a software WDT with different timings for each.

There are many, many reasons an ESP can disconnect from a router / server.

Many of the reasons are buggy code written by the user of the ESP.

Sometimes neighbouring WiFi or microwave devices that become more active in the evening can be a problem. More people simply being around in the evening can also affect ESP’s.

I could go on and on but I think you get the idea.

Since the Community site went online there has been 73400 posts and less than 1% of these had no follow up. Most of this 1% will be posts that didn’t require a response. If you check through the thousands of posts you will see that all issues are resolved if the user with the problem provides the required information to warrant investigation.

@shur1k If you’re interested in continuing with Blynk (and I think it is worth the effort) then post the code that you’re using and details of how you’ve set-up your app and I’d be happy to try it on one of my devices to see if it’s an environmental issue for you.
I’d also be happy to give some feedback on the code if it looks like that might be causing an issue.

Another approach is using Blynk with MQTT. This is what I do and it works very well.
I have a Raspberry Pi running Mosquitto with Node-Red installed as well. Node-Red has a Blynk plug-in and when you use it with the Blynk Cloud server it’s an easy way to get remote access to data and to remotely control devices in your home.

Pete.

Actually, before asking here, I tried a lot of different things. And one of them was just to use the Blynk blink example. So, no my “buggy” code was there. And the problem was the same. But nevertheless, I’ve just restarted my both devices. And flashed one them with a simple Blynk Timer example. Just set the timer event interval to 60 seconds and put this code to timer event handler:

    void myTimerEvent()
    {
      if (Blynk.connected()) {
        Serial.print("[");
        Serial.print(millis()/100);
        Serial.print("]");
        Serial.println(" Blynk is connected");
        if (WiFi.status() == WL_CONNECTED) Serial.println("WiFi is Connected"); 
        else Serial.println("WiFi Connection is lost");
      }
     else { 
        Serial.print("[");
        Serial.print(millis()/100);
        Serial.print("]");
        Serial.println(" Blynk is not Connected any more");
        if (WiFi.status() == WL_CONNECTED) Serial.println("WiFi is Connected"); 
        else Serial.println("WiFi Connection is lost");    
     }  
    }  

Will see how long will it take to stay connected.

@shur1k yeah, let’s wait. Connection drop is the normal situation. The problem here - seems that your sketch doesn’t reconnect after the connection was lost. (in the last few days there actually were few traffic reroutings on the server).

Thanks @Dmitriy! That is what I was asking few post ago, do the Blynk reconnects automatically or I need to do it manually from the my sketch? Now I see, I need to do it manually. Thank you for the clear answer!

@shur1k actually - it depends. Most of default Blynk sketches reconnect automatically within Blynk.run(). However, we need to see your code to make any conclusions.

1 Like

There are various bugs in the latest release of the ESP8266 core and many of them are related to the default lwIP.

ESP’s should be manually rebooted after EVERY local flash if you want it to reboot after a crash.

Without this it will never reconnect to the Blynk server as the ESP is effectively powered off.

Don’t you think that would have been useful information to include in the OP.

Most problems are user bugs, fact, so the assumption will always start with this until the user can demonstrate otherwise.

2 Likes

I can share it.

It was done so. And several times rebooted after the lost of the connection.

@Dmitriy, can you, please, explain a bit here? What does it mean “most”? What is the condition of code/board/settings which will impact on the ability to reconnect to server?

There are just few examples that manually handle connections, all others are with auto reconnect.

Ok, I have both devices disconnected. Here is the log from the second one, which was running the test firmware:

[121358] Blynk is connected
WiFi is Connected
[12138438] Heartbeat timeout
[12143311] Connecting to blynk-cloud.com:8441
[12143917] Certificate OK
[12143951] Ready (ping: 33ms).
[121958] Blynk is connected
WiFi is Connected
......
[127358] Blynk is connected
WiFi is Connected
[12784311] Heartbeat timeout
[12789148] Connecting to blynk-cloud.com:8441
[12794149] Connecting to blynk-cloud.com:8441
[12795768] Certificate not validated
[127958] Blynk is not Connected any more
WiFi is Connected
[12796150] Login timeout
[12799150] Connecting to blynk-cloud.com:8441
[12804151] Connecting to blynk-cloud.com:8441
[12809152] Connecting to blynk-cloud.com:8441
[12814153] Connecting to blynk-cloud.com:8441
[12814661] Certificate not validated
[12816154] Login timeout
[12819154] Connecting to blynk-cloud.com:8441
[12819534] Certificate not validated
[12821155] Login timeout
[12824155] Connecting to blynk-cloud.com:8441
[12824538] Certificate not validated
[12826156] Login timeout

So, after the second try it couldn’t reconnect any more to the server.

So you are using SSL?

1 Like