Extern Lib Package

Hello,
i have to add a lib package (libmodubus and fieldbuslib) to my project.
I haven't downloaded the package neither from github nor internet, i have it on a workmate pc.
I have zipped the package so i can add it to the Arduino IDE 2.0.x and i have did it.
The problem is when i compile it, i get the following error:
"H:\Documents\Arduino\libraries\Libmodbus\src\modbus-tcp.c:49:11: fatal error: netinet/ip.h: No such file or directory".
"# include <netinet/ip.h>"
I check the file where these header are and i didn't find the /ip.h.
The question is: how can i overcome this problem?
In other words, what have i to do get the /ip.h header ?
I am using ESP32S3

Thans in advance

Which Arduino? And what library are you talking about?
I suspect it's THIS one, where I can't see any reference to Arduino, that library is declared to be "for Linux, Mac OS, FreeBSD and Windows".
In fact, it seems "netinet/ip.h" is part of THIS code from FreeBSD, and I don't know if it can be used with Arduino.

If you need to work with Modbus, why don't you use a standard Arduino library, like THIS for example?

Indeed it is

To be specific, the Arduino IDE cann't find #include <netinet/ip.h> in the header:
modbus-tcp.c

So you thinnk i should use the standard Arduino library.
I am using ESP32S3 DevKitC-1 N8R2 with Arduino IDE 2.2.1

Yes, because you need also that "netinet" library.

You're right, if you're using ESP32 you can't/don't (but you haven't specified your board before :wink: ).

So, even if I never userd ESP32 with modbus, in this case I think you can have a quick search for an ESP32 Modbus library. For example, see and try THIS ESP32 specific library

Thank you but THIS is specific for ESP IDE and not for Arduino.
I will search a one for Arduino IDE

As I didn't know either how you connect to Modbus or what IDE you want/need to use, my previous link was just an example. So googling for "ESP32 modbus arduino ide" could help you more than me. :wink:

Thank you anyway

Have a look at THIS I hope you can get useful information about that...

Thanks, i saw it and i would try it.
I may have a chance.

I need a Modbus library package that is compatible with the Fieldbus library package.
When i compile This with Fieldbus in Arduino IDE i get an error which says:
netinet/ip.h not found.
I searched on the net and i found a ip.h and downloaded but then i got other problems.
So now i will be looking for some library which would be compatible with Fieldbus lib package.

Did you installed a ESP32 support package for Arduino IDE?

Hello @b707
what do you mean with ESP32 support package?

As Hardware for RS232 to TTL is THIS the right choice or should i chose other interface?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.