CPU load during HTTP response can get sockets stuck

Posted on
Page
of 2
Prev
/ 2
  • Ok, with the following code:

    digitalWrite(A14, 0);
    
    Serial2.setup(115200, { rx: A3, tx : A2 });
    at = require('AT').connect(Serial2);
    at.debug();
    
    at.cmd('AT\r\n', 10000, function(data) {
      console.log(data);
      at.cmd('AT\r\n', 10000, function(data) {
        console.log(data);
        at.cmd('AT\r\n', 10000, function(data) {
          console.log(data);
        });
      });
    });
    
    digitalWrite(A13, 1);
    digitalWrite(A14, 1);
    

    I see the following:

    Erasing Flash...
    Writing....
    Compressed 114368 bytes to 1807
    Checking...
    Done!
    Loading 1807 bytes from flash...
    ["AT\r\n"
    =undefined
    ] "r" <--- "r"
    ] "rl\x00l" <--- "l\x00l"
    ] "rl\x00l\x9C\x90" <--- "\x9C\x90"
    ] "rl\x00l\x9C\x90r" <--- "r"
    ///// SNIP ////
    ] "rl\x00l\x9C\x90r\x02\x8Cc\x02\xE2n\f\f\­f\x8C\x1C\x80l\xEC\fb|\x8E\x82\x9E\x00\x­ECp\x02\x92\x9E\x8F\x92\x9C\xECl\fb\x8Cp­~\xF2n\x9F\x00lno\x9C\x13c\fc\x1Cp\x8C\x­8Flrlrlp\xF2o\xE0\x82\x9C\x00\f\f\x82\x8­F\x80l\f\f\f\f\f\fb\fn\xE3\xE3n\x8C\x1C\­x8E\x8C\x8E\x8C\f\fc\x8C|\x7F\xF2o\xEE\x­02l\x8C\x8F\x00l\x03\x90\x13\x12on\f\x8Erl\x0E\x03nr\x8F­\x92\x9Es\x02\f\f\x02\fl\x02p\xF3n\xE0\x83\x9C\fs\x8C\x9C\x8C|\x­7F\xF3\x02\x0F\x03n\x8C\xEF\x03\f\f\x90s­rl\x8E\x12\xF4\r\nready\r\n" <--- "\x12\xF4\r\nready\r\n"

    so there is definitely 'ready' in there, but I guess Espruino is missing it because of the full buffer?

    I've hacked in a workaround for now. Calling AT+RST myself, waiting for the junk callback and then handing off to Espruino_WiFi module to do a normal initialisation.

  • I don't know - it should have got that, since it's got a newline before and after. If it's printing it then it's in the buffer and hasn't lost it. Perhaps it just takes longer to boot than Espruino expects - although Espruino does leave 10 seconds?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

CPU load during HTTP response can get sockets stuck

Posted by Avatar for dave_irvine @dave_irvine

Actions