ModbusTCP Server sockets max number

Hi to everyone again! I've been dealing with PLC IDE in order to set up a ModbusTCP server. Works fine after read some examples.

Once running, it accepts up to three working sockets (three paralell clients). Is it possible to increase this value?

I found this answer for Arduino boards:

But no luck on Opta on PLC IDE 1.0.3

Hi, I'm not sure if this applies equally to the Opta as it does to the GIGA, but on the GIGA I needed to follow the instructions below to build a custom version of the libmbed.a library having added

      "lwip.socket-max": 12,
      "lwip.tcp-socket-max": 10,

to the mbed_app.json file.

Why, with all the resources of these boards, Arduino took a conservative approach with some of the configuration is a mystery to me.

1 Like

Perhaps this can shed some insight:

tcp sockets memory usage Arduino

Hey :slight_smile: Any luck increasing the max socket number?

Hi @ppp-one , not tried yet. I reported the issue to Arduino support and got a kind email. Acoording to it, Arduino is actively working to address this behaviour, but there is not release date to solve this. I've checked that the server releases the orphaned sockets afters a few hours, but this expiry should be a few minutes.

My latest planed trick to solve this is a modbus-based countdown watchdog.