Home automation with Arduino - What communication protocol do you use?

Hi all, I just finished my personal home automation project with Arduino. I developed a C# server application that works as "home server" in order to manage my house. This application interacts with the Arduinos connected with sensors/actuators. These are all Arduino compatible, sono directly connected.

My qyestion is: now the c# application server connects to arduino with an ethernet shield with a simple socket connection. I heard someone using other communication protocol like Modbus: Someone could say to me when modbus is better (obviously exclude cases where sensors NEED this protocol...) Someone of you usually use other communication protocols?

Thank you very much.

I had a lot of experience programming website back and front ends prior to getting into Arduino, so I use HTTP. One major benefit is that I can utilize the robust logging functionality of Apache for communication between my "home server" and Arduino.

Between server and Arduino I use Modbus, either TCP or RTU mode. It is a well developed standard and allows you to mix with devices that do adhere to the standard.

I use HTTP between server and web based client as that is also a standard. I make strong use of AJAX and serialise my data as JSON when requesting data from the server.

I developed a gateway server with both Modbus and HTTP integrated in the one C application. The Modbus continually polls the I/O devices and holds all real time data in memory, while the HTTP server can dish up this data to connected HTTP clients. You can read more at my signature.

Using socket connections, say web sockets between web client to server allows faster and bi-directional data. Using socket connection between your application and Arduinos means you need to develop the underlying protocol for taking care of the data, sequencing and errors, hence why Modbus is gaining popularity in recent years again as an open and well behaved protocol that can operate over all media.

There are many standards you can pick form and so you have many choices you can make based on your needs. I developed the Modbus /HTTP gateway in order to avoid the sluggishness and bloat of using Apaché and friends, especially for running on small ARM based boards.