You are reading a single comment by @net-tobi and its replies. Click here to read the full conversation.
  • I think the problem is within the AT lib. It just handles lines which end with \r\n. On the SIM900 you have to wait for "> " before sending the data after sending AT+CIPSEND=...

    The "> " is not ending with \r\n therefore it is not sent back to the callback provided to at.cmd()

    My send method currently looks like this:

      send : function(sckt, data) {
        if (at.isBusy() || socks[sckt]=="Wait" || sockBusy[sckt]) return 0;
        if (!socks[sckt]) return -1; // error - close it
        sockBusy[sckt] = true;
    
        var cb = function(r) {
          at.debug();
          console.log('-->' + JSON.stringify(r));
          return cb;
        };
        sockSent[sckt] += data.length;
        console.log('Send '+ data.length + ': ' + JSON.stringify(data));
        console.log('Total: ' + sockSent[sckt]);
        at.cmd('AT+CIPSEND='+sckt+','+data.length+'\r\n', 3000, cb);
        return sockSent[sckt];
      }
    
About

Avatar for net-tobi @net-tobi started