Hi,
Quick question (hopefully).
I sometimes get .-2 connection errors when I am trying to reconnect to AWS MQTT Core, sometimes they come and others not, it is inconsistent. It has cropped up because I want to demo the functionality and normally between connections there is a long period, now I have reduced it to less than one minute.
It says here in the API that it is network error but it isn't, due to the inconsistency. Often it will try twice or three times, then let me in.
https://pubsubclient.knolleary.net/api
I think it is because I am not disconnecting properly, then AWS is not handshaking because it thinks I am still connected. The documentation specifies
"cleanSession boolean (optional)"
The existing code implementation of the function is:
mqttClient.connect(broker, 8883)
I have tried to add this cleanSession to the end of the line but can't get anything to work. Ive tried, true, free, and various numbers, the IDE says try 'free' but that doesn't work.
Has anyone tried this?
Thanks