Yes I have been using MQTT.fx tool. When the Arduino is stuck, and I send on or off message or even wait to listen for messages I do not get any. That is how I am also determining that the Arduino is stuck or hung up.
I have added many serial. print in my other code which is based on this simple code. Even this simple code gets stuck so I wanted to determine the root cause of the issue. Just wanted to know if I have functions being called to perform any other work, having serial.print in those function will also break the code?