Skip to content

How can I detect Modbus communication errors in ModbusMaster? #384

Open
@SajjadQadri

Description

@SajjadQadri

Hi @emelianov 👋

First of all, thanks for developing this great Modbus library for ESP8266!

I am using your library in a project that involves both Modbus TCP and Modbus RTU communication modes, and I need to implement comprehensive error handling.

Could you please clarify the following points:

  1. How can I effectively detect and manage all Modbus communication errors (such as CRC errors, timeouts, illegal function codes, invalid data addresses/values, connection losses, etc.) when using your library?

  2. Does your library provide any specific methods or error codes for all operating modes, including Master, Slave, Server, and Client roles in both TCP and RTU modes?

  3. When an error occurs in the Modbus data frame or communication, what kind of return values or error indicators do the library functions give? For example:

    • Do the read/write functions return booleans or error codes?
    • Is there a way to retrieve detailed error information after a failed request?
  4. Is there a recommended or built-in approach in your library to handle retries, logging, or recovery from errors in a robust way?

Please explain these to me with examples.
Understanding these will help me implement a reliable monitoring and control system.

Thanks a lot for your time and support!

Best regards,
Sajjad Qadri

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions