Lively.js is a simple illustration of using MQTT as a device presence indicator
git clone git://gist.github.com/1832048.git lively
cd lively
npm install .
node lively.js ...
- Connects to broker with a will topic set to --topic and will payload set to --not-present
- Publishes --present to --topic
- Pings until dead
- Once dead, publishes --not-present to --topic or relies on the broker to do so.