Ethernet2 - connecting to 8 sockets - fail

Hi, I am using

Arduino mega 2560 with Wizz5500 ethernet shield v2 Modbus TCP/IP protocol

I am trying to open 8 sockets and read data from the meters using Etherent2 library. But every time the arduino is getting restarted and communication is not happening.

Previously I used Wizz Ethernet library which worked perfectly. But there we could only open 4 sockets at a time.

Please advice.

sounds as though you could be running out of memory can you try changing the heap size?


Thanks for your response.

For each loop I close all the sockets and open again. So I don't think it is a memory issue.

is it on the first attempt to open 8 sockets it fails or after several loops? sounds like a memory allocation problem - perhaps the C++ destructors are not deallocating buffers correctly what happens if u increase the heap size?

You are using the Ethernet2 library, correct? Your include should be

#include <Ethernet2.h>