You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • 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...

About

Avatar for Gordon @Gordon started