I'm trying to use the Modbus.h library with a NANO Every and I'm getting this error message (see attached) that points to a problem with the Client and IPAddress classes. My sketch just calls the libraries at this point and doesn't do anything else so no reason to post that. The libraries compile when I use a Mega2560 board environment. Is there an issues Mega4809 with these classes, and if so what kind of changes do I need to make to the code?
This is the library:
Error_Nano_ModbusLibrary.txt (28.6 KB)
I had the same problem.
If you want to use ModbusRTU, you can simply delete all files that contain "tcp" in the file name from the library (also in the ArduinoModbus/src/libmodbus folder). Also delete the corresponding lines (or comment them out) from ArduinoModbus.h.
That worked well for me.
Thanks for the input. I initially played around just commenting out the TCP libraries from the ArduinoModbus.h file. Thought that would stop the file look up. I can play around more and delete files too.
One thing that's bugging me about this library is that it is not using standard holding register addresses as defined in the Modbus documentation.Would any client understand the hex addresses? I'm trying to set-up a nano, but I'm playing around with a Mega at the moment just to make sure my components and wiring work, to communicate with a computer over USB, specifically Matlab. I'm able to read with a different library (this one) but haven't been able to write to my device yet. Do you know if the ArduinoModbus library server class is designed to work with any client?
How are you using your set-up? Any help would be greatly appreciated.
-Ryan