MODBUS on the Pi

First of all, I would like to point out that MODBUS is a 30+ yr old protocol that completely sucks by todays standards. However, since virtually all the industry in the world still uses it, here we go…

The purpose of this article is to show how you can use a Raspberry Pi to communicate over the MODBUS protocol so that it can be used like an industrial controller. I am using it to build a simple home security and automation system.

This article is getting very long, so I have broken it up into pages.

Part 1 Compiling MODBUS on the Pi a very basic example to get you started.

Part 2 Adding functionality to make it more useful, emulating some larger data structures from existing MODBUS devices.

Part 3 Interfacing with IO’s.

Part 4 Creating a MODBUS Server Application to communicate with the Pi.