You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • The ESP8266 problem is because of their stupid use of Linked/Unlinked with no connection number. The SIM900 shouldn't have that.

    I guess the problem here is that at.isBusy() is reporting false because it's not actually busy, just waiting for >.

    Why not add your own variable to track whether you're waiting or not?

    send: function(sckt, data) {
        if (at.isBusy() || this.sendWaiting || socks[sckt]=="Wait") return 0;
        if (!socks[sckt]) return -1; // error - close it
        this.sendWaiting = true;
        var f = function(d) {
          at.unregister('>');
          this.sendWaiting = false;
          if (d != sckt + ", SEND OK") return; // <------- this doesn't seem to do anything?
        };
        at.register('>', function() {
          at.write(data);
          return "";
        });
        at.cmd('AT+CIPSEND='+sckt+','+data.lengt­h+'\r\n', 10000, f);
        return data.length;
      }
    
About

Avatar for Gordon @Gordon started