The sketch works fine off the Arduino IDE, but when I removed it from the computer and tried to run it as standalone, it would not play...
I reconnected to the computer and I discovered that in fact the sketch will not run if the Serial monitor is not active in the IDE!!! So I assumed that the calls to Serial are blocking (shouldn't be the case, IMHO), and I commented out all the references to serial, including Serial.begin(), so that any communication is done purely through MQTT.
It still does not work!!
Even if nothing is written to the serial terminal, the script will not run if the terminal is not open. If it is open it runs absolutely fine.
I am using the latest Arduino IDE on Linux. My ESP8266 is the "Witty" board, which I specify as NodeMCU 1.0 (ESP 12-E Module) to the IDE and has always worked fine for everything else.
What am I doing wrong?
Sorry if the answer is obvious, I'm a Lua guy, only using Arduino because Lua doesn't have the rc-switch library... Although I admit I found it fun using Arduino, especially since I can use C++ and not just C, I'm sure I'll be using it lots more...
First really need to sort this out, though!
Cheers!