Feeling MQTT Thick

Oh firstly, after filling in the form with Espressif to keep commercial confidentiality about their SDK info which I’m still waiting for – I discover it’s freely available here – http://www.esp8266.com/viewtopic.php?f=5&t=449  granted that IS for the 0.9.2 version which is a tad old now..

Tonight as I get ready for a round of meetings in London which will severely hamper my research until later this week, I’m struggling with MQTT-SPY. I should say I’ve had some communication with the designer and he’s been MORE than helpful  – he’s added a demo time script, he’s changed the XML format slightly so it’s readable for the likes of Notepad++ all of which is great, but I want some pre-programmed scripts to send out publications – and can I HELL figure out how to use them.  I’m hoping for an update to the WIKI on that otherwise excellent free program. If nothing else I hope to set off a script every minute to transmit the time on “/time” and I can keep an eye on it while I’m away on business to check for reliability.

I didn’t get a chance today to update the ESP-12, now that the MQTT code works so well in the Windows environment, to add port operations to that as I thought I might use a couple of pins of the board as indicators instead of all that serial info. All I want coming out of the serial is MQTT messages.

My unashamedly Windows-only ESP8266 Facebook page  is doing well and how has over 170 followers which is nice.

Not much else is new. Quite interesting that people made so much noise about the Lua interpreter code going open source – the guys did that and what’s happening? Not  a lot right now.. the Frankenstein code? Nothing for a month….   the beta of the SDK? Nothing new.  Maybe everyone’s having the week off after Christmas.

Here’s hoping for lots of new developments over the weekend. Something I don’t really understand about the Lua code – it’s constantly short of RAM – and yet, those who are trying to understand the chip say that it has a LOT more DRAM than it has RAM… so I wonder if any of that is being used.. perhaps that will remain one of life’s mysteries.

And on a completely unrelated subject – if you’ve been struggling with your old Nexus 7 (2012) – the 5.01 Android update is out -  installed it today (with a lot of wheel-re-inventing) – and.. yes, I think it speeds it up again.

11 thoughts on “Feeling MQTT Thick

  1. I must say thank you for all the research you’ve done. I’ve been reading your blog every day for the last week, just waiting on new ESP8266 or MQTT nuggets.

    I’ve been working to use the ESP8266 in a rather complex project and the MQTT Firmware has been a godsend. My design would have replicated 40-50% of the functionality of the MQTT protocol, but it would have been tied into my main application. This opens up so many more options, not to mention the massive reduction in development time.

    My original plan was to use a handful of the cheap Arduino Pro Mini clone modules with the ESP8266 and allow the Arduinio to do the heavy lifting. The -12 version of the ESP module means I may be able to do away with the Arduinio for most of the devices I’m building.

    Until I can get the ESP8266 toolchain to work (I’ve followed the Windows Dev how-to with little success) I’ve been playing with the paho MQTT library for Python. This works so well and is so easy it doesn’t seem possible.

    Thanks again!

  2. For your scripting have you tried using node and one of the MQTT libraries you can run on it? I know you’re a Windows person but you can get node working under that or better yet use a Raspberry Pi or similar which is pretty much a one line install.

    I’ve started playing around with MQTT thanks to all your posts here, I imagine I’m a week or so behind you but I’m very excited at its potential as the fabric for homebrew IoTs. Particularly I’ve a bunch of different devices, lights, a boiler and sensors that all currently talk something different. Being able to have them all use the same messaging system makes it much easier to feed in information from sensors that weren’t meant to be communicating eg my temperature sensors were for a different project but a quick subscribe to their topic and when the house is below a certain temperature turn the heating on to stop pipes freezing.

    • Hi James – thanks for writing in. I’m not yet familiar enough with Node to use it… are you aware of a REALLY simple Windows-oriented example of such use and why it would be worth one’s time?

      As for Pi, I did consider that as an alternative to a service on a PC which could in theory pack in – I would not have said that last week having used the same PC without issue (Windows 7) for several years but as it gave up due to a hardware fault only this week I am of course open to suggestions (don’t say Linux). I considered the Pi but my concerns about lack of power were amplified in something I read about Pi running Mosquitto – the guy writing the article said that if you fired a load of stuff at it, it would process all incoming messages and not until it was idling would it get around to actually firing the responses back – this of course is useless. If the guy is talking rubbish – please do tell. I’m wondering if Really Small Message Broker – which runs an absolute treat as a service on a PC, might be an idea for Pi? I don’t have one and it would be a slight learning curve to set on up so I’d like to be sure it’s worthwhile before going down that route.

      Re: your comments about devices, yes we are on the same route here, I have devices I already use and devices I’d like to use at home, in a holiday rental property (www.hollyberry-cottage.co.uk) and miles away in our little place in Spain (www.bedrock.es). Having on, reliable message broker to serve all 3 and to now have a common language for them all, controllable from my Android phone or tablet, is my goal and if I can do the lot myself, all the better. The MQTT implementation appears good enough even in this state where the author says it should not yet be used in production. Adding a DHT22 sensor to the ESP8266 code is my next challenge as that then forms a remote temperature/humidity sensor without even bothering to strap on an Arduino. I’m thinking single Lithium battery and reasonable solar cell. Isn’t this fun.

      • RE: node – its simply javascript running outside the browser but it could be really useful for this sort of thing because of its event based model and easy ability to talk to web apis.
        Its the work of a moment to do something like:
        var sub = mqtt.subscribe(‘/kitchen/temperature’);
        sub.on(function(temperature) {
        if (temperature < 10) {
        //turn on the heating

        Certainly its something you can do with other scripting languages like Python but I suspect you will find it hard to beat that in terms of readability or ease not to mention there are a ton of useful javascript libraries for accessing web apis eg to get the weather then you could publish that over mqtt.

        As to the speed of a Raspberry Pi with mosquitto well I'll have to try that out. I love that a Pi is so small and low powered so it makes a lot of sense to use one to run these things rather than a full computer running Windows. I know you don't like Linux but frankly I find it a lot easier to use now-a-days compared to Windows and it is just flat out better for this sort of task. Currently though I'm running my MQTT broker on the AWS cloud and its working well – I think it kind of makes more sense to keep it there so that it can easily be accessed from different locations.

        Looking forward to your DHT22 code – that's something I intend to wire up with a photoresistor once I get a ESP8266 with an ADC at the moment I only have an ESP-01.

  3. I’ve been playing around with MQTT.fx (http://mqttfx.jfx4ee.org/) as a replacement for MQTTSpy. So far it seems pretty decent although it may not be suitable for your use case. It does allow you to run scripts which can publish/subscribe to/from topics. Might be useful for testing. The author thus far has been responsive to my requests. Check it out if you’re interested.

    • So Glenn – it’s basically down to whether one’s service provider has NODE fitted is that it or can I put it on myself. I have a full website – with multiple WordPress sites – and full FTP access to the site… is it as simple as uploading NODE.JS to the site?

      • Just looked at site – I’ll revise that.. I take it you put the node.js stuff on your computer… I’m not seeing anything here about tablets..

  4. Hi Glen.

    I have to say that the MQTT-SPY author has been more helpful than I could possibly ask for, the product is already better than it was a couple of days ago as a direct result of our conversations – if he can just show me how to make the automated scripts work – and then alter his instructions so they are fathomable, it’ll be a GREAT product.

    I’m now sitting in front of MQTT.fx. Initial reactions. Looks GREAT but could do with some pretty colours. Also initially I could not see the message itself, I suspect this was written by someone with a MAC by the look of it? Not that it matters.

    You seem to need to open the reply to see the message – not sure I like that. – the notifications option is marvelous.

    Not sure what Broker Status is about but it wasn’t showing my anything about the broker I’m using and which I’m attached to as I test this.

    Scripts – lots of assumption here.Clicking edit asks me what I want to use to edit the scripts with – that ASSUMES I already understand what I’m doing – questions like – what? What kind of script? Where’s it supposed to go? What can I put in scripts? I think a load of examples built in would be good.

    Are these reasonable observations for someone seeing this for the first time?

    • Sure . . . they’re reasonable assumptions. I’ve only played with MQTT.fx a little bit and just offered it as an alternative in case the MQTTSpy developer wasn’t responsive enough for your tastes. It’s always good to have several alternatives . . . another hammer for your toolbox 😉

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s