ModbusIP library problems with ENC28J60 ethernet chip

TL:DR, I need someone who knows the ENC28J60, and knows how to keep a tcp connection alive.

I am using this library to handle modbus on my Arduino Ethernet

On the Arduino Ethernet I can get it to work, but when I switch to this board KMtronic Ltd: KMTronic DINo Internet/Ethernet I/O board which uses the ENC28J60 chip, I can no longer get it to work.

The way I use it, I got an Universal Robots to control the modbus, and for that to work I need to uncomment #define TCP_KEEP_ALIVE in the ModbusIP.h file. When keep alive is commented out, the green dots are randomly blinking green/gray, but with it uncommented the connection is stable and all dots are green.

With the ENC28J60 based board, the green dots are always blinking gray/green, no matter if keep alive is uncommented or not, so I suspect it got something to do with that. But I cant figure out what is wrong, so I am looking for help from someone who understands the ENC28J60 library better than I do. :slight_smile:

Also, testing it with the UIPEthernet library, it works, but VERY slow and unreliable.

With my Arduino Ethernet I can run all in and outputs at 10Hz, and it is replying stable at 8-9ms, with the UIPEthernet library it runs at 15-30ms, with spikes over 350ms.

Another problem I am having is also that only the first input is working correct. The others always show as activated, I suspect it to be something in the modbus protocol not being handled correct by ModbusIP.

I have seen an add-on-lib that allows for use like the 'original ethernet lib...

knut_ny:
I have seen an add-on-lib that allows for use like the 'original ethernet lib...

Yes, that is the UIPEthernet which I tried too, but it is just way too slow, and using a lot of memory too.