Tag Archives: MQTT

Latest interviews, and upcoming speaking schedule

Just a quick note to comment that I’ve added links to two recent interviews on the media section of my Speaking and Media page:

I’ve been at QCon London this week and also did a couple more interviews, again one on each of these topics – it may take slightly longer for these to emerge, though. Let me know if you have any feedback on these, always interesting to hear!

It may seem hard to believe, and indeed looking back at my schedule it hardly seems it, but I’ve been avoiding too many speaking gigs since an annoying incident back in December and a need to take a break! Coming up in the next few months, apart from the job change (!), I’m back on the road and I’ll be speaking at the following events:

About these ads

A little bit of Spring and MQTT

I’ve been involved with Spring (the Java framework, not the season…) for a couple of years now – since I joined VMware in 2012 through the former SpringSource organisation in the UK – and I’ve remained “involved” with it through my transition to Pivotal and the framework’s evolution into Spring 4 / Spring.IO under Pivotal’s stewardship.

To be clear, although I’ve been a “Java guy” / hacker through my time at IBM, I have never been a hardcore JEE coder, and my knowledge of Spring itself has always been limited. My good buddy Josh (MISTER Spring, no less) has done his best to encourage me, I briefly played with Spring Shell last year with @pidster, and the brilliant work done by the Spring Boot guys has been helpful in making me look at Spring again (I spoke about Boot – very briefly, as a newcomer to it – at the London Java Community unconference back in November).

Taking all of that on board, then, I’m still an absolute Spring n00b. I recognise a lot of the benefits, I see the amazing work that has gone into Spring 4, and I’m excited by the message and mission of the folks behind the framework. I would say that though… wouldn’t I? :-)

[considering this is my first blog post in a while, I’m taking a while to get past the preamble…]

This week, I chose to flex my coding muscles (!) with a quick diversion into Spring Integration. With a long history in WebSphere Integration back in my IBM days, this was both something of return to my roots, and also a learning experience!

With the new Spring.IO website (written with Spring, and hosted on Pivotal Web Services Cloud Foundry, fact fans!), the Spring team introduced the new Spring Guides – simple and easy-to-consume starter guides to the different technologies available in the Spring family. I knew that the team had added MQTT support via Eclipse Paho, so I thought I’d take a look at how I could modify a Spring Integration flow to take advantage of MQTT.

Incidentally, there’s complete reference documentation on the MQTT support, which is helpful if you’re already familiar with how Spring Integration works.

The resulting simple project is on Github.

Once I’d figured out that it is useful to ensure the latest versions of the various modules are listed as dependencies in the build.gradle file, it wasn’t too hard to adapt the Guide sample. In the example, the docs lead a developer through creating a new flow which searches Twitter and then passes tweets through a transformer (simply flattening the tweet sender and body into a single line of text), into an outbound file adapter.

The bulk of the changes I made were in the integration.xml file. I wanted to replace the file output with the tweets being published to an MQTT topic. To do that, I added the int-mqtt XML namespace information to the file, and configured an outbound-channel-adapter. It was also necessary to add a clientFactory bean configuration for a Paho MQTT connection. You’ll notice that, by default, my example posts results to the test broker at Eclipse (iot.eclipse.org port 1883 – an instance of mosquitto for public testing). Full information on how to build and test the simple example can be found in the project README file.

Thanks to my colleague Gary Russell for helping me to figure out a couple of things, as I was a Spring Integration newcomer!

M2M Community at EclipseCon

Day 2 of EclipseCon 2013 and we’ve already been seeing some strong interest in the M2M community and the kinds of projects we have been working on!

The story so far

There were two  M2M events on day one. The first was the M2M tutorial featuring some real hardware (Raspberry Pi and Arduino), using the Koneki Lua Development Tooling to deploy scripts to the embedded Mihini runtime on the Pi to drive and take input from sensors over Modbus. I cheated a little and mixed in a bit of MQTT using the Paho Lua client, to have my kit publishing temperature and light data to a broker instead :-) It is early days for Eclipse Mihini, but it was a really slick demo and tutorial, and I’m looking forward to playing with this a lot more.

The evening Birds of a Feather session gave a group of us a couple of open hours to hack around with our Pi and Arduino kits. My own efforts were slightly thwarted by a European soldering iron and a 110V power supply, so I wasn’t able to assemble the add-on board I wanted for my Raspberry Pi, but I’ll get back to that in the future. For those looking to explore their new Raspberry Pis and hardware / GPIO interaction from Java, take a look at the pi4j project.

Building a community

One useful “war story” that was told today was in Benjamin Cabé’s Building the M2M Community talk. The slides will follow, but it was good to hear about the progress of the community and projects involved (yes, ok, I’m a Committer on one of them…) and also to hear about his “Community Manager Toolbox” for tracking and responding to community discussions. I use a very similar set of tools when I engage with the Cloud Foundry and MQTT communities (and others that I’m involved with).

Here’s a summary:

  • Slideshare – monitor who favourites and downloads slides related to your project
  • Twitter – monitor hashtags, engage complainers
  • YouTube – screencasts, demos, build channel to aggregate content
  • StackOverflow – answer questionss (even old ones), find answers that need to be complemented)
  • Github – monitor forks, stars, look for people using your tech (include Gists)
  • Google Alerts
  • IFTTT – e.g. if Eclipse wiki changes get Gtalk notification recipe
  • Google Analytics for your site
  • LinkedIn – monitor groups, post news and relay blog posts

In short: Engage the community. Be very public about what you are working on and where the roadmap is going. Get management buy-in for your projects to persuade them of the value of opening them to the community (use metrics to demonstrate take-up).

Working on standards

The other thing that has been going on today “behind the scenes” at EclipseCon has been the first meeting of the OASIS MQTT Technical Committee. It is exciting to see that Richard Coppen and Raphael Cohn have been elected as co chairs of the group, with seven sponsoring organisations from across the technology and messaging market and 35 publically-visible members – lots of interest in MQTT!

 

M2M, IoT and MQTT at EclipseCon 2013

EclipseCon 2013 is here, and I’m in Boston with the great folks from around the community this week.

Koneki, Paho, Mihini

There’s a LOT of content around the machine-to-machine space this year, and growing interest in how to use instrumented devices with an embedded runtime with lightweight messaging. If you’ve not been following the progress of the M2M community at Eclipse, we now have an M2M portal, along with nice pages for each of the three associated projects Koneki, Mihini, and Paho.

M2M hardware kits

Almost the first thing I saw when I walked in yesterday was my buddy Benjamin Cabé assembling a bunch of electronics kits (Raspberry Pis and Arduino Unos) for today’s M2M tutorial which will use Eclipse Koneki and Mihini. This will be the first opportunity for many folks to play with the new Mihini runtime. Later this evening, we’ll have the chance to run a hackathon with things like Raspberry Pi and Orion and others parts as an extended Birds of a Feather.

What are some of the other M2M sessions to look out for?

There’s also the first meeting of the OASIS TC for MQTT due this week, and a meeting of the Eclipse M2M Industry Working Group scheduled as well. Exciting times!

The corridor conversations and late night beer sessions are as always invaluable, and myself and many of the other project folks will be around – I’m always happy to talk about Paho in particular. At Paho we now have updated Java and C MQTT clients in Git (NB check the ‘develop’ branch for the latest Java updates), along with the Lua client, and proposed contributions of Objective-C, Javascript and Python clients are at various stages of review looking to join the project.

Oh, and if you are interested in MQTT, come and find me for some MQTT Inside stickers that you can use with your own hardware projects :-)

Eclipse Paho gets started…

Since the announcement of Eclipse Paho (an Open Source project under the Machine-to-Machine umbrella at Eclipse) there has been a fair amount of excitement in the MQTT community about the availability of IBM’s C and Java client code under an Open Source license.

The initial proposal and setup stages have taken a little while, but this week the initial availability of the C client code was announced on the Paho mailing list (Java will follow shortly).

PahoHALF

Paho Quickstart

This is not intended to be a comprehensive guide – better documentation etc will emerge over time – but I thought I’d post a quick guide as a kickstart for anyone wanting to give it a look. I did this on 64-bit Ubuntu 11.10 – similar steps will apply on other Linux or UNIX platforms (note, the initial code contribution has a Makefile with rules which should work on UNIX, Windows, or z/OS).

Install the necessary packages to build code. NB git is for grabbing the source from Eclipse; build-essentials is a metapackage providing gcc etc on Ubuntu; and doxygen and optional graphviz are used for generating the documentation.

sudo apt-get install git build-essentials doxygen graphviz

Get the code from the git repository:

git clone git://git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.c.git

Quick build for the client library and documentation:

cd org.eclipse.paho.mqtt.c.git/src
make -f ../build/Makefile all
doxygen ../doc/DoxyfileV3ClientAPI

Once these commands complete, you should be left with subdirectories called <platform> and docs. In my case, <platform> was 64-bit Linux, so I had a binary at linux_ia64/libmqttv3c.so. There’s no “make install” rule at the moment, nor is there a rule to compile the docs so I had to run doxygen directly. In the future it would be nice to automate all of that, and also to build some test applications.

Opening docs/html/index.html in a browser reveals very nice documentation describing the client library, including some examples of how to use it. For example, in docs/html/pubasync.html there’s a complete listing for an asynchronous publisher application. I extracted that code into pubclient.c and decided to check that it worked!

gcc -Wall pubexample.c -L./linux_ia64 -lmqttv3c -lpthread -o pubexample

That command successfully built a binary called pubexample. All I needed to do was test it. The sample application assumes that an MQTT broker is available on localhost port 1883 – if you want to change that, simply modify the value of the static variable ADDRESS in pubexample.c – in my case I simply apt-get installed the mosquitto and mosquitto-clients packages onto my system, but I could equally have unzipped and run Really Small Message Broker – both start on port 1883 by default if not given alternative configuration.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./linux_ia64/
./pubexample
Waiting for publication of Hello World!
on topic MQTT Examples for client with ClientID: ExampleClientPub
Message with token value 1 delivery confirmed

It was trivial to test that a subscriber (mosquitto_sub in my case) also received the publication. Job done!

Getting involved, and other news on Paho

I mentioned that the Java client contribution should appear soon. One other piece of news this week is that the project’s sandbox broker implementation – based on mosquittohas been spun up. That was posted on the Paho mailing list, and if you want to get involved you should definitely subscribe to that; start to track the Eclipse Bugzilla for Paho; watch the Paho wiki; keep an eye on the source repositories; etc.. I’m already thinking about getting an OS X build rule sorted out. If you want to test your sample code now, you’ve got the option of a local broker, the Eclipse Paho sandbox, the mosquitto sandbox, or various other implementations.

Oh – and please leave a comment on this post if you find this information interesting, or want to discuss where things are with Paho. I’ll be hanging out on the mailing list as well.

What about Bob? (or Andy, even!)

Well, although I’ve left IBM, I’m delighted that MQTT is now going Open Source – in fact that was one of the things that I really wanted to help to achieve before I moved on. I am really pleased that I will be able to continue to contribute to both Paho and the broader Eclipse M2M Industry Working Group. I’ll be helping to update the mqtt.org community site, and heading over to EclipseCon in Virginia in a couple of weeks’ time to talk about M2M and work with our friends from the Koneki project. If you are attending EclipseCon please come say hi to me – and you may be interested in Wes Johnson’s session on MQTT and Eclipse tools.

There are very cool times ahead!