ENC28J60 , UIP lib and Modbus TCP

I have used the Mega and a Wiznet shield and that works with DHT11 for home A/C control.
I am wanting to use the Nano 328 or Pro mini boards to keep things small. I am not having any luck getting the Mudbus lib to run on the Nano 328. I can ping it but not able to make a connection with my tablet using a modbus tcp master application.
Has anyone tried this combination? I am wondering if the CPU on the nano is being overloaded. I am able to get data from the DHT11 via the monitor port. I have removed that code to lessen the CPU load, but still I can not get connected. I can ping it and that is about all. I am using the UIP lib to set up the ENC28J60

I have done that using a PIC PIC18F26K20 with an ENC28j60 writing my own small modbus tcp server over the pic tpc/ip stak so, I guess what you are trying to do should be possible

I run firmata on Nano with UIPEthernet-lib doing 1-Wire and other Stuff. That being said a nano is capable to run simmilar functionality. Don't know about modbus-ram-requirenments though - UIPEthernet requires a good amount of 15-20kb (depending on sketch an use of UDP/DHCP/DNS).

I found the issue , the time it took to read the DHT11 was taking too much cpu time
I slowed it down as the temperature does not change fast and that gave more cpu time to handle the modbus tcp communications. I found a nice nano ethernet shield. I wish they used a wiznet chip instead thou.

yes - the formfactor of those nano ethernet-shields is quite nice. Actually the fact that you cannot get those with WIZ5100 but with ENC28J60 only was my initial motivation to write UIPEthernet :wink:

  • Norbert

hai friends ,
i need modbus tcp example program for arduino uno

I found this library GitHub - andresarmento/modbus-arduino: A library that allows your Arduino to communicate via Modbus protocol, acting as a slave (master in development). Supports serial (RS-232, RS-485) and IP via Ethernet (Modbus IP). but it's not working. my sketch is freezing at mb.config(mac, ip);

corsavec:
I found this library GitHub - andresarmento/modbus-arduino: A library that allows your Arduino to communicate via Modbus protocol, acting as a slave (master in development). Supports serial (RS-232, RS-485) and IP via Ethernet (Modbus IP). but it’s not working. my sketch is freezing at mb.config(mac, ip);

Dear corsavec!
I think you need to change CS pin in ModbusIP_ENC28J60.h to the same pin what is defined in the UIP library (may if its defined in the uip lib, but why not… I doesnt use the UIP lib. :P).

#define ENC28J60_CS 8 //Default chip select pin

I use the ethercard library, and andrasemento uses it too in his modbus library… Another thought, try to use the ethercard library insted the UIP library for the ENC28J60 module.
This CS pin changing helped me to get alive the modbus system.

Robert