Tag Archives: video

OS X mosquitto “bites”…

In my post last week about the new MQTT support coming to WebSphere MQ I very briefly mentioned that there are some third-party tools that already implement MQTT. One of those I pointed to is the very neat mosquitto broker, a project started by Roger Light.

mosquitto has been around for a while now and is aiming to replicate the functionality of the Really Small Message Broker that is on IBM alphaWorks. One of the neat things about it, from my point of view, is that it there is an Ubuntu PPA repository, so with a couple of apt commands, I can install a running MQTT broker and build my own applications independently (NB there are packages for other Linux distros too, as well as Windows). When I want to do some “heavy lifting” or share data with my ESB, I connect up my local mosquitto broker to pass messages across to WebSphere MQ through the new telemetry channels – because MQTT supports a concept of bridges, and both RSMB and mosquitto both include support for bridging.

I noticed that there wasn’t yet a version available for Mac OS X but figured that it shouldn’t be too difficult to compile and run it on that platform. As it happens, it did turn into a bit of an adventure for a couple of reasons, but at least I learned from the experience. If you’re desperate to build yourself a version to try some MQTT development on the Mac, here’s what I had to do to get it going on Snow Leopard:

  1. Installed mercurial, and a GUI for it called Murky (which requires the hg command line tool from the base mercurial package). The sources for mosquitto are in bitbucket, a Mercurial repository… this is optional of course as I could have just used a source tarball.
  2. Grabbed the latest mosquitto source from bitbucket.
  3. Modified the Makefiles throughout the mosquitto tree to build libraries with a .dylib instead of a .so extension (the default on OS X), and also changed the -soname parameter to -install_name which the OS X version of gcc understands.
  4. At this point the compile was starting to show progress… but failing due to missing symbols… the offender being one from sqlite, _sqlite_enable_load_extension. Turns out that the version of sqlite shipped in OS X 10.6.x is 3.5.4 but it does not have extension loading functionality built in, as evidenced by nm -g /usr/lib/libsqlite3.dylib | grep 'sqlite3_enable'
  5. Downloaded sqlite3.8.0, configured it to install to /usr/local (to avoid overwriting the default OS X shipped version), and built and installed it with no issues.
  6. At this point the compile was pretty smooth, once I modded Makefile link and include lines to point to the new version of sqlite in /usr/local. The only thing that failed was documentation, but that was “optional” 🙂
  7. Trying to start the broker failed… because it was trying to load the sqlite3-pcre extension.
  8. Installed git (the source for the sqlite3-pcre extension is in a git repository).
  9. Grabbed the source for sqlite3-pcre and built and installed it using:
    gcc -shared -o pcre.so -L/usr/local/lib -lsqlite3
              -lpcre -Werror pcre.c -I/usr/local/include
    sudo mkdir /usr/local/lib/sqlite3
    sudo cp pcre.so /usr/local/lib/sqlite3
  10. The final issue was that the path to the pcre extension is hard-coded into mosquitto/src/conf.c so I modded that to point at the version in /usr/local and recompiled. I’m assuming that this would not generally be required, but it worked as a hack to get me going!
    D’oh. Just realised that this is precisely what the ext_sqlite_regex variable in the mosquitto.conf file is for. Shouldn’t have bothered!

So that was it. Being fair, if I hadn’t been feeling my way through that, I would have installed git and mercurial, grabbed all the lib sources for sqlite3 and pcre and built them, built mosquitto, and been good to go. At this point, the broker and test clients are runnable (assuming the library paths are set up appropriately):

DYLD_LIBRARY_PATH=/usr/local/lib ./mosquitto
DYLD_LIBRARY_PATH=../lib ./mosquitto_pub -t test/andy
        -m "hello world"

If you are interested in seeing this in action, here’s a short (and silent, but annotated) screencast:

The Java GUI application you see in the screencast is the test client shipped in an old IBM SupportPac, IA92, a Java implementation of MQTT. The final release of the WebSphere MQ Telemetry component for WebSphere MQ will contain something similar, considerably enhanced and integrated into WebSphere MQ Explorer.

In other news, Roger recently announced version 0.8 of mosquitto, which now has slightly different packaging and includes C, C++ and Python clients. I hope to give these a test drive shortly!


My talk from CRIM Crystal Ball 2010 – video

Following my talk in Montreal a couple of weeks ago, my hosts from CRIM have been kind enough to provide me with the video and have also given me permission to share it online. They’ve also posted a short photo report on Flickr.

See the High Def / full quality version on Vimeo

Also available (lower quality) on Viddler

A 3GS hit-and-run

I hadn’t intended to spend any time at all talking specifically about the iPhone 3GS here on the blog, but following a comment by Per[1] I thought I’d jot down a few notes.

Firstly, given my previous comments about O2 and the upgrade issue… I should explain why I bothered. I got the 3.0 upgrade on the 3G when it came out last Wednesday, and liked what I found, particularly the option to install more than the 2.0 OS limit of 144 / 9 pages of apps. It’s now effectively unlimited, since even if you don’t have space on a home screen, you can search for the app using Spotlight. That’s nice. However, I was already hitting my space limit on the 16Gb 3G, so room to breathe was going to be handy. I also liked the improved navigation and possibility to get the TomTom kit in the future, and once I’d tried the camera in-store, I thought that was going to be a big deal as well (more on that, below). There was a small amount of peer pressure too, given our conversation on last week’s Dogear Nation.

In the end I opted to get a PAYG phone, swap in my contract SIM, and sell the old handset to Mazuma. If I’d waited to upgrade and then wanted the same handset I now have, I’d’ve ended up on another 18 (or 24) month contract with the same upgrade trap in June, and probably on a higher tariff to subsidise the cost of a new handset. This way my existing contract will run out in due course, I stay on the same tariff, and the handset doesn’t cost much more than it would have done come “upgrade” time in 3-6 months.

So what’s good? It’s very clearly nippier. Every operation is obviously faster and cleaner. I’m liking the camera and video recording (zoom would be nice, but variable focus and auto-adjusting exposure/white balance work for me). It was a great move to retain the 3G body and form factor – my Clarifi case still fits perfectly, and the macro lens seems to let me focus marginally closer still than the 3GS can manage on its own (it does a good job by itself, though). Amongst the sprinkling of other functions I like, not specific to the new model, are the landscape keyboard and the improved podcast playback features – did you know you can slide horizontally to scrub through a track, and slide down to scrub more finely? Neat.

The real revelation so far though, has been the screen. The new smudge / grease-resistant coating is a marvel. So far I’ve not fitted a screen protector, and although I’m loath to allow it to become physically scratched, the new screen feels and looks so much better and remains much, much cleaner. It’s just… almost magic.

In the “miss” column we have the voice control feature, which I’m not sure I’ll be using much; and shake-to-shuffle (is this actually supposed to work if the display is locked, by the way? seems not to do so for me, which makes it even more pointless). Oh, and battery life seems worse, but I suspect the compass and the notifications feature are contributing to that, as are the wider range of ways I’m actually using it. May have to think about a Mophie Juice Pack Air.

I used the video function in anger for the first time today, uploading one clip from the Hursley Tri-Department sports tournament directly to YouTube, and later grabbed a set of clips from the phone via iPhoto (yes, iPhoto manages video from the iPhone, go figure) and edited them together in iMovie. It’s not the best quality but probably still as good as my cheap USB camcorder – plus the screen and on-device editing features are nice additions. Rumours are that the chipset is capable of 720p video, but I doubt we’ll get to see that in the current generation of device. I’ve posted a bunch of sample photos to Flickr as well, if you are interested – the Blue Eyeball shot was taken at close quarters with the Clarifi.

Really nothing more to say here. There are more than enough people getting excited about the device and as I said, I hadn’t planned to write up any thoughts – blame that Danish guy 🙂

[1] just because I responded to audience pressure this time, don’t expect me to do it every time, m’kay? 🙂

Video on OS X – more infrastructure

I’ve posted a couple of times now about my experiences creating audio and video on OS X. A couple of weeks ago, I had a brief conversation with my friend Ian Hughes, aka epredator, who was trying to get himself setup:


Good one. All I knew was that DIVX AVI files were playing on my machine fine, through QuickTime.

The answer, which I’d evidently missed before, is Perian. This is a really simple, installable package which enables support for a whole range of “other” file formats in QuickTime. You’ll also want to install Flip4Mac, which gives support for Windows formats like WMV. It’s also worth adding the Xiph component for formats like FLAC and OGG. Once you’ve got those in place, you should be fine to import, play and edit in iMovie and other QuickTime-based applications.

If my content is my CV – where’s my content?

I’ve frequently told folks who come to my presentations that “my content is my CV”. Sometimes, that content can feel a bit dispersed, especially given my habit of playing with a lot of the new services that come along.

I posted about a similar topic a few months ago, but mainly talked about the different blogs I contribute to. Time for a quick round-up of some of the main places you can find that content (you’ll find longer lists on my About, Audio/Video, and Writings pages).

Oh, and the easiest addresses to remember may be andypiper.co.uk or theandypiper.com – both of which will bring you back here.

What is really called for on my part is either a visual CV, or something a bit different like a launch page or an experimental format. When I have time…