Arduino nano with ENC28J60 freezes

Hi,
I am using an arduino nano with ENC28J60 shield and Blynk and as soon as I connect it it works well but then, after some time, it freezes, it hangs up.
It is really annoying as I would like to keep it on and working continuously.

I have read some erratas on the IEPEthenet library but after updated the library I eep having the same problem

Has anyone had a similar problem with this Ethernet shield?

Here is my code:

#include <UIPEthernet.h>
#include <BlynkSimpleUIPEthernet.h>

char auth[] = xxxxxxxxxx;

WidgetLED led6(V6); //register to virtual pin 6
WidgetLED led7(V7); //register to virtual pin 7


void setup()
{

  Blynk.begin(auth);

}

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

I’ve fixed the formatting of your code so that it displays correctly.
Please use triple backticks at the beginning and end of your code in future, like this:

```
Your code here...
```

Pete.

I think you will find that these ethernet shield adapters are one of the most unreliable connection methods, at least with Blynk’s need for a constant link. Much depends on the brand (original or clone), quality of clone, whether or not you use a switch in line with your router (don’t) and even the type of router may have an effect.

Search this forum for keywords like ethernet and start reading… :stuck_out_tongue: Only trial and error will help determine your particular results.

Possible band aid options may include connection management that will reset your Arduino if loss of Server connection. Search for keywords for that as well.

Thanks!
I am sorry for it…
I wikk take it into acount next time. Cheers!

1 Like

Thanks for your reply.

Before I posted this issue I had already read a lot about it.
I found some solution from someone having a watchdog and make some stuff if shield is detected to be freeze.

Almost everyone that uses this shield has this problem so I was hoping that there would be an implemented solution with, or related to blynk. At the end many people use blynk because it is easy to use.

I wanted to use an Ethernet connection because I would like to develop a small security related project. I wouldn’t like to use WIFI connection as it could be easily inhibit with a wifi inhibitor.

I wonder if this known issue happens only this with shield or also with other Ethernet shields?

Any experiences with other Ethernet shields would be appreciate it.

While the cost will be a bit higher, using a RPi model with Ethernet built-in can work quite nicely as both a Local Server and/or client. I am seeing solid Ethernet stability with my RPi3 using both NodeJS and Python clients.

That would be an option. I was thinking about it but the power consumption would increase a lot.
The project is really simple and any arduino should be more than enough. The problem is I need reliability on the Ethernet connection.

You would probably need to pickup an Official Arduino Ethernet Shield for proper reliability… or keep trying different clones… both are not cheap options.

1 Like

I’m sure that when you did your research/reading you came across quite a few personal experiences with Ethernet shields. The majority of these would have been with the W5100 Ethernet shield for the Uno/Mega boards. These shields have design issues that affects the timing of the reset process, which means that even using a watchdog is hit and miss.
The use of Nanos and ENC28J60 adaptors is less common, and so any issues are less well documented. I think many people start with Blynk and an Uno, then add an Ethernet shield, before giving-up with Ethernet and switching to Wi-Fi.

I think the ENC28J60 does have some issues with drivers. The driver libraries seem very large (memory wise) compared to some other types of adapters, and that probably means that a large degree of the ‘work’ needs to be done in software rather than hardware for these adapters.

I’d say that it you want a reliable Ethernet based board then you should probably look at a Raspberry Pi based system. This obviously raises other issues, in terms of cost, size and most importantly which programming language is used.

Pete.

Thanks!!!

I fully agree with everything you comment.

I would really like to keep my project with arduino. Raspberry seems, under my point of view, oversized for my project but in terms of stability of Ethernet…. I might have to move to it.
This is the better I have already found about the issue with the ENC28J60 Ethernet connection. I might work on it before giving the Nano up, although I imagine I will have to forget blynk and think about making my own app….

Hi guys. I want to share an old idea about how to prevent enc28j60 device from freezing. The original idea comes from NYLAMPMECHATRONICS (Peru) They worked with Ethernet library and suggested that one way to prevent freezing is to add some delay after sending the web page. I’ve been working with my enc28j60 and everything is ok.
I couldn`t paste the full code. Please feel free to contact to cypherjohn86@gmail.com. I will send a copy of the sketch and the wiring diagram as soon as possible.

Regards
John