I’m working with the fellow who made MQTT-SPY and I have to say he’s being really helpful and improving the program as we go along.. in a day or so it’ll be just fine…
So, having discovered how to make a SCRIPT which can be automated…. and as it is obvious we’ll be wanting a lot of these running, I thought I’d put it to the test.
Here is MQTT-SPY talking to RSMB which is running as a SERVICE (I described all of this in previous posts – yet another day gone by with NO problems from RSMB acting as a service on my PC).
I’m running the script to send a TIME message (I would think most likely we’d have it send a message every minute in a typical device – so your little on the wall thermostat control might want to NOT have to have a bloody great time library but instead just keep a simple set of variables for the time – in which case, having it’s time updated every minute would be nice… If the internet connection falls over no problem it would keep ticking.
To test both MQTT-SPY and RSMB, I’ve set the script to update every 5ms. I can hear you say “ridiculous” – BUT there might be 10 messages going on and a poor little ANDROID phone trying to get real time updates for a slider or something – it really is important this works smoothly and quickly.
Well once I got past the default setting of only storing 5,000 messages in MQTT-SPY and set it to 50,000 messages (that kept me going for a while).. here it is – flat out NO problem… note in the yellow box I’m up to over 25,000 messages in very short order (very bottom picture)
More’s the point – how is this hammering my PC?… a quick trip to task manager.
Broker is using almost nothing.
Ok that was slightly over the top – but in one of my Android Apps I have 10 buttons on screen with refresh of the indicators every 200ms – that’s an actual call for info every 20ms. Clearly before committing to this – and using this for months or years on end in, say the house – we need to be sure this is reliable – and I have to say – it LOOKS LIKE IT IS.
Next needed is a modification of the MQTT code for the ESP8266 (which was fixed yesterday and looks good) – to include monitoring a /TIME/ subscription and update an internal real time clock… (first part trivial, second part not too difficult) and also some IO and DHT-22 handling (not DHT11 – they are really crap and the Dallas one wire chips don’t do humidity).
So a really simple nice gadget which used ONLY an ESP8266 device might be a thermostat… keep the output LOW (remember GPIO-2 really needs to be + referenced as you don’t want to pull it down on power-up) if the temperature is less than X or Y degrees….else high… and X or Y will depend on 2 times of the day!! Hence the need for the time ( in reality I’d want weekend settings as well and a fallback (cool) option for empty buildings). The unit should also respond to message requests for /TEMPERATURE/ and /HUMIDITY/ – given that you might have more than one you might want to make that /KITCHEN/TEMPERATURE/ etc…
Well, for now I’m almost out of time for a few days (work getting in the way of pleasure) but it’s great to see that – by the look of it – the BROKER is fine and the TEST CLIENT is almost fine (just needs a fix so that publications (ie scripts) restart if the program itself is restarted) … next thing the above – then Android APP and the whole thing starts to come together – hopefully. Did any of that make sense?