// the find
espressif/esp-modbus
ESP-Modbus - the officially suppported library for Modbus protocol (serial RS485 + TCP over WiFi or Ethernet).
Espressif's official Modbus library for ESP32/ESP8266, covering RTU, ASCII, and TCP modes over RS485, WiFi, and Ethernet. It's a clean extraction from the old freemodbus component that was bundled with ESP-IDF, now versioned and distributed as a standalone IDF component. If you're building industrial IoT with an ESP32 talking to PLCs, sensors, or any Modbus device, this is the starting point.
The v2 API supports multiple simultaneous master/slave instances via handles, which the old freemodbus couldn't do — useful if you're bridging RS485 to TCP or running two independent Modbus networks. The test suite is real: adapter tests, physical RS485/TCP tests, unit tests with stubs, and Robot Framework integration tests. That's more coverage than most embedded C libraries bother with. The component integrates cleanly with idf-component-manager, so `idf.py add-dependency espressif/esp-modbus` and it's done. Endianness utilities for multi-register float/double/int64 types are included, which saves you the usual painful byteswap arithmetic when reading 32-bit values from holding registers.
The v2 API is still labeled a beta release in the README, which is a real concern for production firmware — the public interface changed between v1 and v2 and there's no guarantee it won't change again. At 192 stars, the community is thin; if you hit an edge case with TCP slave reconnection or a timing bug in ASCII mode, you're probably raising an issue and waiting rather than finding a Stack Overflow answer. There's no Modbus RTU-over-TCP (encapsulation mode) support, only native Modbus TCP — some older SCADA gateways only speak the encapsulated variant. The documentation lives on a separate Espressif docs site and is adequate but not deep; the examples are your real reference, and they assume you already understand Modbus register mapping.