• Can you post up your code?

    The error is in the ESP8266 library, but that's probably not at fault - there's just so little memory available that it can't allocate memory when it needs it, and it crashes.

    If you want to write to a file, I'd write it a bit at a time - each time you get new data, add it to the end. You might be able to use pipe...

    There's an example of transmitting a file on the Internet page:

    function onPageRequest(req, res) {
      var a = url.parse(req.url, true);
      var f = E.openFile(a.pathname, "r");
      if (f !== undefined) {
        res.writeHead(200, {'Content-Type': 'text/plain'});
        f.pipe(res); // streams the file to the HTTP response
      } else {
        res.writeHead(404, {'Content-Type': 'text/plain'});
        res.end("404: Page "+a.pathname+" not found");
      }
    }
    require("http").createServer(onPageReque­st).listen(8080);
    

    You might just be able to reverse that to:

    function onPageRequest(req, res) {
      var a = url.parse(req.url, true);
      // ...
      var f = E.openFile(a.pathname, "w");
      req.pipe(f); // it should auto-close
    }
    require("http").createServer(onPageReque­st).listen(8080);
    

    but I haven't tried it...

About

Avatar for Gordon @Gordon started