Electronic – arduino – Lightweight Arduino network comms

arduinonetwork-interfaceprotocol

Is there a lightweight networking framework to facilitate network communications between Ethernet/Wireless enabled Arduinos and Linux/Mac/Windows PCs?

Implementing something like being able to read and write the pins or trigger a function from the PC on the Arduino, or trigger an event on the PC because of some input on the Arduino.

I guess I'm just trying to avoid re-inventing a wheel if possible…

Best Answer

You might want to take a look at MQTT:

[MQTT is] ...an open message protocol for M2M communications that enables the transfer of telemetry-style data in the form of messages from pervasive devices, along high latency or constrained networks, to a server or small message broker. Pervasive devices may range from sensors and actuators, to mobile phones, embedded systems on vehicles, or laptops and full scale computers.

Basically, it's a protocol for asynchronous publish/subscribe message passing. You can setup an Arduino to publish data (e.g. sensor readings) to one topic and subscribe to another to receive commands. The PC can subscribe to the Arduino's data topic and send commands by publishing to one of the topics that the Arduino subscribes to.

ActiveMQ implements an MQTT broker. An Arduino library implementing the protocol is available here (github).

I learned of this from Jonathan Oxer's SuperHouse blog, which has some interesting stuff.