Skip to content

[BUG] Modbus RTU slave response time is too high #3037

Open
@raiden00pl

Description

@raiden00pl

Description / Steps to reproduce the issue

I'm just playing with Modbus RTU in NuttX and I see that the slave response time is too long and approximately constant at 50ms. Inter frame delay for modbus is 3.5 character, so this delay is much too high (should be below 10ms).

Image

It is directly related to timeout for this select():

tv.tv_sec = 0;
tv.tv_usec = 50000;
FD_ZERO(&rfds);
FD_SET(iSerialFd, &rfds);
/* Wait until character received or timeout. Recover in case of an
* interrupted read system call.
*/
do
{
if (select(iSerialFd + 1, &rfds, NULL, NULL, &tv) == -1)

Decreasing this value reduces the response time accordingly. It looks like there is something wrong with this serial logic.

Has anyone verified the slave response time with NuttX before? I don't know if it's broken from the start or is it something new.

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

doesn't matter

NuttX Version

master

Issue Architecture

[Arch: all]

Issue Area

[Area: Modbus]

Verification

  • I have verified before submitting the report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions