Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

DanA

Member Since 24 Jun 2011
Offline Last Active Apr 03 2014 04:00 PM
*****

Topics I've Started

MQTT for the Netduino Plus

11 January 2012 - 05:30 AM

Hi,

I received a Netduino Plus for Christmas this year to keep my other Netduino company. After working my way through the "Internet of things" book from O'Reilly, I decided to write a Netduino MQTT client after hearing about MQTT a few weeks earlier.

MQTT is a light-weight protocol for machine to machine communications, or "Internet of things" communications. This seemed like a fun project with my goal being to monitor the temperature, of my desk... Which I sit at... But enough of that! - It's a Netduino with Ethernet! That is cool enough that it doesn't have to be useful yet. :)

I haven't got the temperature bit working (I bought a 1 wire sensor before I learned of the issues that choice brought with it - I'm waiting for an analog solution now :) ), but I have written an MQTT publisher/client that I thought I'd share with you. I've already learned so much from this forum (motor drivers, USB HID, shift registers, etc) that I hope that this might be useful to some of you in your future projects.

I have a page on my blog: http://diabolicalws....tduinomqtt.html

I have this hosted on Github here: https://github.com/d...an/NetduinoMQTT

MQTT operates in a publisher/subscriber model where you either post messages to a named topic or you can subscribe to a named topic. If you publish to that topic, all clients on that broker, who are subscribed to that topic - will get your message. At this point, I have only implemented the publish parts and the most basic QoS level.

If you download the code from GitHub, just add it to a Netduino Plus project, change the Program.cs as needed (IP address, login/passwd, etc), and deploy it, you can send MQTT messages to an MQTT broker (on button press for now).

This project was very fun - I found myself up at 4 in the morning on several occasions - awaiting "one more change". That hasn't happened for me in awhile, so it was quite fun.

Thanks
Dan

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.