MQTT client for iOS and embedded C

2,023 views
Skip to first unread message

Charles Palmer

unread,
Feb 5, 2014, 4:32:47 PM2/5/14
to mq...@googlegroups.com
I intend to develop an application that will initially run on an iPad and later I will implement the same functionality on an embedded platform (processor not selected, but Freescale Kinetis family looks good). So I'd like to choose an MQTT client library that will be similar or the same for both platforms, to minimise porting work. Any suggestions?

Ian Craggs

unread,
Feb 7, 2014, 5:50:16 AM2/7/14
to mq...@googlegroups.com
The Paho C MQTT clients (http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.c.git/) have been tested on iOS, so will work there.  We at IBM were advised not to develop an Objective C client at the time for legal reasons, but we made sure the C clients would work.

These clients will work in embedded environments, but do take up 70 or 80k, and do use standard socket, pthread, malloc calls.  I've started a new C client specifically for embedded environments here: http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.embedded-c.git/.  I've started with a lower layer that is very simple and does not rely on any networking, threading or memory allocation libraries.  I've shown this working in the mbed environment: https://mbed.org/users/icraggs/.

A top layer for the embedded client could look like the Async Paho C client interface (http://www.eclipse.org/paho/files/mqttdoc/Casync/index.html).  Or more like the Paho Java client interface if the top layer were in C++.  Or both.  Either way, the intent is that the embedded client is structured as a set of building blocks, so if you want only the smallest implementation, you can just grab the pieces you need.

Ian Craggs

martin

unread,
Feb 10, 2014, 9:13:56 AM2/10/14
to mq...@googlegroups.com
I can appreciate IBM wanting to avoid any legal issue, but has anyone else published some instructions on how to incorporate the Paho C client into an ObjectiveC iOS app? I have written a couple of apps but I'm still a noob when it's comes to linking in external libs.

Ian Craggs

unread,
Feb 10, 2014, 5:37:26 PM2/10/14
to mq...@googlegroups.com
Yes, we have written some instructions, a while back - here: https://www.ibm.com/developerworks/mydeveloperworks/blogs/c565c720-fe84-4f63-873f-607d87787327/entry/getting_started_with_messaging_on_ios?lang=en

I expect they need updating, so any feedback would be appreciated.

Ian

martin

unread,
Feb 20, 2014, 5:06:06 PM2/20/14
to mq...@googlegroups.com
I don't want to sound ungrateful, but those instruction were no help at all. The download redirects to the Paho home page (http://www.eclipse.org/paho/), where I think I downloaded the right thing (http://build.eclipse.org/technology/paho/C). But the contents of the downloaded zip file doesn't match what is mentioned in the instructions. I eventually wound up here http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/topic/com.ibm.mm.tc.doc/tc10155_.htm#tc101553 but couldn't face writing make files by hand. I was kind of hoping I could just drag and drop a library or framework into XCode then include it in my ViewController.

martin

unread,
Mar 4, 2014, 7:28:47 AM3/4/14
to mq...@googlegroups.com
Dear All, 

To make amends for the negativity in my last email :-) I thought I'd share with everyone a great iOS MQTT library I eventually found called MQTTKit by Jeff Mesnil. It is basically a nice Objective-C wrapper around the Mosqitto 1.2.3 library. It installs simply into the XCode IDE using CocoaPods and there is an example iOS app here https://github.com/jmesnil/MQTTExample


Jeff, you are a star!


Reply all
Reply to author
Forward
0 new messages