A lightweight, hardware-agnostic, Modbus RTU/TCP library

GitHub Build Status Coveralls branch Donate

Liblightmodbus is a lightweight, highly configurable, hardware-agnostic Modbus RTU/TCP library written in C99.


  • Modbus RTU and TCP support
  • Independent from the hardware layer
  • Modular structure helps to minimize the resource usage
  • Callback-based operation
  • User-defined memory allocator support (static memory allocation is possible)
  • Support for custom Modbus functions; 01, 02, 03, 04, 05, 06, 15, 16 and 22 are implemented by default.
  • A (very) experimental C++ interface
  • ESP-IDF component

Check the online documentation for more technical information.


If you face any problems, please refer to the docs first. If you can't find answer to your question there, please open an issue. Hopefully this will help to form some kind of a FAQ list. If you want to help - you can contribute on Github or donate. Both donations and contributions are very welcome :heart:

Getting started


A lightweight, header-only hardware-agnostic Modbus RTU/TCP library

Liblightmodbus Info

⭐ Stars 162
🔗 Homepage jacajack.github.io
🔗 Source Code github.com
🕒 Last Update 5 months ago
🕒 Created 6 years ago
🐞 Open Issues 0
➗ Star-Issue Ratio Infinity
😎 Author Jacajack