Disconnect problems

Hey Guys!

I am having a problem with my sketch that’s randomly keeps disconnecting and sometimes takes a long time to connect or doesn’t connect till I make a reset or a couple of resets.

Here is my situation:
Hardware: Arduino Mega 2560
Ethernet: ENC28J60
All libraries are updated (yesterday)
IP settings:Static IP

Yesterday night at about 1:30AM the device was connected.

This morning about 6:30, the device went offline and only woke up after a manual reset.

I read somewhere that the device can disconnect in case of over communication… read/writes…
But it was not the case… No special comunications were used… Only simple routines.

Any ideas how can I bypass this?

Well, without seeing your code, it’s not possible to say if it’s caused by bad coding or not.

Ethernet shields for Arduino boards are notorious for connection issues that require a hardware reset (or multiple resets until they finally decide to play nicely - until next time).
It’s possible that your router renewed the lease for your Ethernet shield (if you’re using DHCP) which may have caused the issue. An interruption to your internet connection, maybe when your ISP allocated a new dynamic public IP could also have been the cause. Or it might have been caused by a power brownout, or a pig flying past the window :pig2::pig2::pig2:

I eventually gave up on Arduino and Ethernet shields and started using NodeMCU devices instead and have never looked back.

Pete.

Yeah I realize that Arduino Ethernet shields have lots of problems.

I know that without the code it’s hard…

https://drive.google.com/file/d/1sD5fu9mMnfADe6Od5PPlbRrwAGAVMcYn/view?usp=drivesdk

I got the link. It’s a easy and simple and short sketch.

Can you have a look please?

Thanks for your help!

The is the Central heater and solar energy of my house.

In summary it measures the pressure of the Central Heat and gives more pressure of needed (I need about 1.5bar). I can turn the Central on and off.

Then I have the control for the solar energy. Know the temperature of the water, the level… Then I can put water in it, turn on the heat Element if needed!

I have a domoticz integration.

Thanks again for your help@:slight_smile:

I’ve taken a quick look at the code and nothing jumps out at me an being problematic.

Maybe time to go for a NodeMCU or Wemos D1 Mini instead?

Pete.

Yeah I think I will try. I have one nodemcu and several esp12 at home.

I only prefer the Ethernet modules to avoid one extra wireless network frying my brain at home :rofl:

I tried 28j60… The wiznet w5100… All of them with some kind of bugs…

Maybe it’s time for a change!

Thanks a lot @PeteKnight

1 Like