[Submission] MQTT Library and Sample

@kyngston , I haven’t used this in awhile, but what I’d do is something like my reconnect function above and I’d also replace all the delays I had in my last code samples above with :

            lastTime = millis();
            while(millis() - lastTime < 1000)  {Spark.process();}

The 1000 would be for 1 sec delay. Use 100 for 100 ms delay, etc. lastTime is defined as

uint32_t lastTime;

Also I’ve found my photons are extremely sensitive to my microwave oven and so I’ve had to devise a way for them to gracefully connect back up w/ the cloud. I think I more or less solved that (
Microwave hardening). Some of my photons would go into fast cyan blink when the microwave is used. Are you using the cloud at all?
Let me know if this helps