You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Thanks - as you say, no response even to the first CIPSEND.

    Have you tried just sending the CIPSEND command manually and seeing if you can get it to go sending something simple? It might be it wants a newline after the text that's sent?

    The other option is to go for Ctrl+Z terminated mode:

      send : function(sckt, data) {
        if (at.isBusy() || socks[sckt]=="Wait") return 0;
        if (!socks[sckt]) return -1; // error - close it
        var f = function(d) {
          if (d=="> ") return f;
        };
        at.cmd('AT+CIPSEND='+sckt+'\r\n'+data+"\x1A"/*ctrl+z*/, 10000, f);
        return data.length;
      }
    

    That'd be easier but will cause you problems if you want to send binary data.

  • Hello again,

    I tried it manually. When I wait for the "> " to appear, it works:

    ["AT+CIPSTART=0,\"TCP\",\"http://www.pur3.co.uk\",80\r\n"
    =0
    ] "\r\n" <--- "\r\n"
    ] "OK\r\n" <--- "OK\r\n"
    ] "\r" <--- "\r"
    ] "\n0, CONNECT OK\r\n" <--- "\n0, CONNECT OK\r\n"
    >at.cmd('AT+CIPSEND=0,5\r\n');
    ["AT+CIPSEND=0,5\r\n"
    =undefined
    ] "\r" <--- "\r"
    ] "\n> " <--- "\n> "
    >at.cmd('HELLO');
    ["HELLO"
    =undefined
    ] "> \r" <--- "\r"
    ] "\n0, SEND OK\r\n" <--- "\n0, SEND OK\r\n"
    ] "\r" <--- "\r"
    ] "\n0, CLOSED\r\n" <--- "\n0, CLOSED\r\n"
    

    Do you have an idea how I can wait for "> " using the AT-lib?

    Best,

    Tobias

About

Avatar for Gordon @Gordon started