• It is probably just a case of modifying the codebase you are using. Here is some code that runs ESP8266 as station and access point.

    let ap_ssid="test";
    let ap_authMode="wpa_wpa2";
    let ap_pwd="testtest";
    let st_ssid="ssid";
    let st_pwd="pwd";
    let port=8080;
    let http = require('http');
    let wifi = require("Wifi");
    let startServer = function(port){
      let server = http.createServer(function (req, res) {
          res.writeHead(200, {'Content-Type': 'text/html'});
          res.end(`AP IP: ${wifi.getAPIP().ip}</br>STA IP: ${wifi.getIP().ip}`);
      console.log("server started");
    console.log("disconnecting all..");
    // start ap
      "authMode" : ap_authMode,
      "password" : ap_pwd
      if (!err) {
        console.log("AP started");
      } else {
        console.log("could not start AP"); 
      // conect as station
      wifi.connect(st_ssid, {password:st_pwd}, (err) => {
        if (!err){
          console.log("station connected");
          console.log("could not connect as station");

    The server/page can be connected to on AP IP: (port 8080) and the router allocated IP of in this example.

    Both the AP IP and station IP are displayed in the page.

    AP IP:
    STA IP:

    Perhaps you can modify from here to suit your needs.


Avatar for Ollie @Ollie started