• Alright so I simplified down and the same issue persists.

    const wifi = require("EspruinoWiFi");
    const http = require('http');
    
    const startServer = () => {
      http.createServer(function (req, res) {
        console.log('got http request');
        console.log(req);
        
        getPage((data) => {
          console.log('got http response');
          console.log(data);
        });
      }).listen(80);
      console.log('http server started');
    };
    
    const getPage = (callback) => {
      http.get("http://www.pur3.co.uk/hello.tx­t", function(res) {
        let data = '';
        console.log("Response: ",res);
    
        res.on('data', function(d) {
          data += d;
        });
    
        res.on('end', () => {
          callback(data);
        });
      });
    };
    
    wifi.connect('realAP', {
      password: 'realPW'
    }, (err) => {
      if (err) { throw err; }
    
      console.log('wifi connected');
    
      wifi.startAP('ourAP', {
        password: 'ourPW',
        authMode: 'wpa2',
      }, (err) => {
        if (err) { throw err; }
    
        console.log('ap started');
    
        getPage((data) => {
          console.log(data);
          startServer();
        });
      });
    });
    

    When I log the incoming http requests I'm definitely seeing corrupt data so I'm fairly sure the http.get is somehow looping back onto the softAP rather than going out via the station.

    "method": "b390b887c80\"",
    "url": "\nAccept-Ranges:",

About

Avatar for dave_irvine @dave_irvine started