Ahh, ok. Can you try this code for send please?
send: function(sckt, data) { if (busy || at.isBusy() || socks[sckt]=="Wait") return 0; if (!socks[sckt]) return -1; // error - close it busy = true; at.register('> ', function(l) { at.unregister('> '); at.write(data); return l.substr(2); }); at.cmd(`AT+QISEND=${sckt},${data.length}\r\n`), 10000, function cb(d) { dbg("AT+QISEND response "+JSON.stringify(d)); if (d=="") return cb; // handle \r\n before > if (d=="SEND OK") busy = false; else { // probably d=="SEND FAIL" at.unregister('> '); socks[sckt] = null; // force socket close } }); return data.length; }
If that works, I'd be interested whether it works without the if (d=="") as well...
if (d=="")
@Gordon started
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.
Ahh, ok. Can you try this code for send please?
If that works, I'd be interested whether it works without the
if (d=="")
as well...