Disconnecting every 5 minutes in Blynk

Good night, I’m getting disconnect every 3-5 minutes in my Blynk, my code was working right…

I tried to upload the Blynk ENC28J60 and I’m still getting disconnect every 5 minutes…

Code:

 #define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
 #include <UIPEthernet.h>
 #include <BlynkSimpleUIPEthernet.h>

 // You should get Auth Token in the Blynk App.
 // Go to the Project Settings (nut icon).
 char auth[] = "My token...."; // (BLYNK) Código Token

 void setup()
 {
   Serial.begin(9600);
   Blynk.begin(auth);
   // You can also specify server.
   // For more options, see Boards_Ethernet/Arduino_Ethernet_Manual example
   //Blynk.begin(auth, "blynk-cloud.com", 8442);
   //Blynk.begin(auth, IPAddress(192,168,1,100), 8888);
 }

 void loop()
 {
   Blynk.run();
 }

What’s going on? I tried to reboot the PC and Arduino.

First off, your method of posting your code is incorrect, don’t use the carrot > before each line, wrap the whole code in between backticks like this:

Otherwise it look like your defines and libraries (and possibly other code) are not syntaxed correctly:

define BLYNK_PRINT Serial // Comment this out to disable prints and save space
include UIPEthernet.h
include BlynkSimpleUIPEthernet.h

should look like:

#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include UIPEthernet.h
#include BlynkSimpleUIPEthernet.h

And how are you currently connecting? You mention rebooting the PC, and since your ethernet based Blynk.begin() commands are commented out, my first guess is via USB-link… but you do not have the required library listed:

#include <BlynkSimpleStream.h>

Also, if using the USB-Link, you should comment out define BLYNK_PRINT Serial as it will conflict with the Serial of the Blynk.begin()… which is also wrong for USB-Link as it should be Blynk.begin(Serial, auth);.

Or add software serial and change it to something like define BLYNK_PRINT SwSerial as in this example: http://examples.blynk.cc/?board=Arduino%20Uno&shield=Serial%20or%20USB&example=GettingStarted%2FBlynkBlink

Thanks for the tip. I changed the code formatting… I was using # but when you post with #, it goes Strong…

Yes, I was connecting and interacting with my Arduino…

I’m not using the library <BlynkSimpleStream.h>, it’s not included in Blynk sketch… Should I use it?

In my own code I disabled the BLYNK_PRINT Serial, but It was still disconnecting…

I’ll try software Serial tonight…

I know that :wink: but how were you connecting? Ethernet, Wifi, USB, telepathy

What library, the <BlynkSimpleStream.h>? It is included in the Blynk Libraries download. You insert it or other library calls into a sketch as required. I did include a link to a USB connection example in my post - you can try that with the USB link method to see if that is stable.

I’m using ENC28J60 module which is connected with my arduino board, I’m connecting my Arduino Mega with an USB cabble which is plugged in my computer.

The library came with Blynk zip archive my in examples but in examples which came with zip files, they don’t call for this library in the code…

OK, so you have two ways of connecting to Blynk. Ethernet or USB, each uses different libraries and procedures.

Focus on the Ethernet first and try the Sketch builder to experiment with different examples:

http://examples.blynk.cc/?board=Arduino%20Uno&shield=ENC28J60&example=GettingStarted%2FBlynkBlink

If all of those still seem to disconnect, then switch to the USB link, described here: http://docs.blynk.cc/#hardware-set-ups-arduino-over-usb-no-shield
And a video demo here: Arduino Uno and USB step by step tutorial

Then start with these examples:

http://examples.blynk.cc/?board=Arduino%20Uno&shield=Serial%20or%20USB&example=GettingStarted%2FBlynkBlink

In either case, make sure you are using the latest library 0.4.6 and app 2.12.4 versions.

The USB connection which I mentioned, is only for power supply and for uploading the sketch… My focus is ENC28J60…

And the example which you mentioned to connect the ENC28J60 is exacly like mine, so, my sketch isn’t the problem right? It’s not missing any library, correct?

There are many examples in the Sketch builder. But I don’t know what your library status is (in your Arduino folders).

The purpose of mentioning the USB link is an alternate connection method to help establish if the disconection issue is specifically related to your ENC28J60 or perhaps something else, such as your wiring, router, etc.

The library which I’ve in my arduino folder are the libraries found in blynk archive, version 0.4.6 (or something like that… It’s the newest one)

I changed the cables, I used my computer cable and it was still disconnecting…

So, I activated the BLYNK DEBUG and that’s what happened before it disconnect. It’s not reconnecting anymore, to reconnect I’ve to reset my Arduino.

1682. [161681] <vw[00]15[00]62.000
1683. [161712] <[14|00][[00|0C]
1684. [161740] <vw[00]16[00]62.000
1685. [161771] >[14|1E]b[00|05]
1686. [161800] >vr[00]15
1687. [161831] >[14|1E]b[00|05]
1688. [161848] >vr[00]14
1689. [161869] >[14|1E]b[00|05]
1690. [161897] >vr[00]16
1691. [161917] >[14|1E]b[00|06]
1692. [161946] >vr[00]100
1693. [162139] >[14|1E]b[00|05]
1694. [162140] >vr[00]10
1695. [162141] >[14|1E]b[00|05]
1696. [162149] >vr[00]15
1697. [162169] >[14|1E]b[00|05]
1698. [162198] >vr[00]14
1699. [162219] >[14|1E]b[00|05]
1700. [162247] >vr[00]16
1701. [162268] >[14|1E]b[00|06]
1702. [162295] >vr[00]100
1703. [163045] <[14|00]\[00|0A]
1704. [163046] <vw[00]100[00]163
1705. [163139] >[14|1E]b[00|05]
1706. [163139] >vr[00]10
1707. [163140] >[14|1E]b[00|05]
1708. [163149] >vr[00]15
1709. [163170] >[14|1E]b[00|05]
1710. [163197] >vr[00]14
1711. [163219] >[14|1E]b[00|05]
1712. [163247] >vr[00]16
1713. [163267] >[14|1E]b[00|06]
1714. [163296] >vr[00]100
1715. [164149] >[14|1E]b[00|05]
1716. [164150] >vr[00]10
1717. [164151] >[14|1E]b[00|05]
1718. [164159] >vr[00]15
1719. [164179] >[14|1E]b[00|05]
1720. [164208] >vr[00]14
1721. [164229] >[14|1E]b[00|05]
1722. [164257] >vr[00]16
1723. [164278] >[14|1E]b[00|06]
1724. [164305] >vr[00]100
1725. [166138] >[14|1E]b[00|05]
1726. [166139] >vr[00]10
1727. [166140] >[14|1E]b[00|05]
1728. [166149] >vr[00]15
1729. [166170] <[14|00]][00|0A]
1730. [166198] <vw[00]100[00]166
1731. [166238] >[14|1E]b[00|05]
1732. [166255] >vr[00]14
1733. [166276] >[14|1E]b[00|05]
1734. [166304] >vr[00]16
1735. [166325] >[14|1E]b[00|06]
1736. [166352] >vr[00]100
1737. [167138] >[14|1E]b[00|05]
1738. [167139] >vr[00]10
1739. [167140] >[14|1E]b[00|05]
1740. [167148] >vr[00]15
1741. [167170] >[14|1E]b[00|05]
1742. [167197] >vr[00]14
1743. [167218] >[14|1E]b[00|05]
1744. [167246] >vr[00]16
1745. [167267] >[14|1E]b[00|06]
1746. [167294] >vr[00]100
1747. [169245] <[14|00]^[00|0A]
1748. [169246] <vw[00]100[00]169
1749. [172345] <[14|00]_[00|0A]
1750. [172346] <vw[00]100[00]172
1751. [175446] <[14|00]`[00|0A]
1752. [175447] <vw[00]100[00]175
1753. [176600] <[14|00]a[00|0C]
1754. [176611] <vw[00]13[00]27.000
1755. [176612] <[14|00]b[00|0C]
1756. [176620] <vw[00]14[00]27.000
1757. [176651] <[14|00]c[00|0C]
1758. [176679] <vw[00]15[00]62.000
1759. [176710] <[14|00]d[00|0C]
1760. [176739] <vw[00]16[00]62.000
1761. [177317] <[06|00]e[00|00]
1762. [178545] <[14|00]f[00|0A]
1763. [178546] <vw[00]100[00]178
1764. [179318] <[06|00]g[00|00]
1765. [181319] <[06|00]h[00|00]
1766. [181645] <[14|00]i[00|0A]
1767. [181646] <vw[00]100[00]181
1768. [183317] Heartbeat timeout: 183317, 167316, 181319
1769. [184745] Cmd skipped:20
1770. [186320] Connecting to blynk-cloud.com:8442
1771. [201821] Cmd skipped:20
1772. [201821] Cmd skipped:20
1773. [201822] Cmd skipped:20
1774. [201832] Cmd skipped:20
1775. [202099] Cmd skipped:20
1776. [202099] Connecting to blynk-cloud.com:8442
1777. [217605] Cmd skipped:20
1778. [217605] Cmd skipped:20
1779. [217606] Cmd skipped:20
1780. [217616] Cmd skipped:20
1781. [217641] Cmd skipped:20
1782. [217668] Connecting to blynk-cloud.com:8442
1783. [233216] Cmd skipped:20
1784. [233216] Cmd skipped:20
1785. [233217] Cmd skipped:20
1786. [233227] Cmd skipped:20
1787. [233252] Cmd skipped:20
1788. [233279] Connecting to blynk-cloud.com:8442
1789. [248825] Cmd skipped:20
1790. [248825] Cmd skipped:20
1791. [248826] Cmd skipped:20
1792. [248837] Cmd skipped:20
1793. [248862] Cmd skipped:20
1794. [248889] Connecting to blynk-cloud.com:8442

i have same problem with you…unstable conected…

Do you use ENC28J60 module?

@hbadotti I think @Kangmas_Hadi is using the lottery connection method (ESP downgraded as shield to a lowly Arduino) so it’s nothing to do with ENC28J60, which is normally very reliable.

i am combine dimmer, timmer, and temperature controller