The calls to the ESP8266 will be asynchronous, so I guess it's possible that the driver isn't correctly delaying the creation of the new MQTT connection, and so is trying to re-use the apServer socket that hasn't yet closed?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
So you're saying that if you just run
require("MQTT").create
on its own, without the AP, it works?Can you try doing something like:
And see if that works ok?
The calls to the ESP8266 will be asynchronous, so I guess it's possible that the driver isn't correctly delaying the creation of the new MQTT connection, and so is trying to re-use the apServer socket that hasn't yet closed?