     //netsend(n, buff);
   } else if (req[n] == 2) {
     char wifilist[CWLAP_MAX_LEN] = "";
-    commandWaitCallback_P(PSTR("AT+CWLAP\r\n"), 10000, 1000, &callbackCWLAP, (void*)wifilist);
-    while(waitData(100)) {
-      readLine();
-    }
     netsend_P(n, STATUS_200);
     netsend_P(n, headers_A);
     netsend_P(n, headers_B);
     netsend_P(n, HTML_PART_A);
     netsend_P(n, PSTR("Arduino httpd"));
     netsend_P(n, HTML_PART_B);
-    netsend_P(n, PSTR("<label>WiFi networks:</label>\r\n<ul>"));
+
+    NParams nparams;
+    commandWaitCallback_P(PSTR("AT+CIFSR\r\n"), 1000, 1000, &callbackIP, (void*)&nparams);
+    commandWaitCallback_P(PSTR("AT+CWSAP_CUR?\r\n"), 1000, 1000, &callbackIP, (void*)&nparams);
+    commandWaitCallback_P(PSTR("AT+CWJAP_CUR?\r\n"), 1000, 1000, &callbackIP, (void*)&nparams);
+
+    netsend_P(n, PSTR("<label>Network parameters:</label><ul><li>SOFTAP NAME: "));
+    if (nparams.APNAME[0] != 0) {
+      netsend(n, nparams.APNAME);
+    } else {
+      netsend_P(n, PSTR("DISABLED"));
+    }
+    netsend_P(n, PSTR("</li><li>SOFTAP IP: "));
+    if (nparams.APIP[0] != 0) {
+      netsend(n, nparams.APIP);
+    } else {
+      netsend_P(n, PSTR("DISABLED"));
+    }
+    netsend_P(n, PSTR("</li><li>WLAN NAME: "));
+    if (nparams.JAPNAME[0] != 0) {
+      netsend(n, nparams.JAPNAME);
+    } else {
+      netsend_P(n, PSTR("NOT CONNECTED"));
+    }
+    netsend_P(n, PSTR("</li><li>WLAN IP: "));
+    if (nparams.STAIP[0] != 0) {
+      netsend(n, nparams.STAIP);
+    } else {
+      netsend_P(n, PSTR("NOT CONNECTED"));
+    }
+    netsend_P(n, PSTR("</li></ul>"));
+    
+    commandWaitCallback_P(PSTR("AT+CWLAP\r\n"), 10000, 1000, &callbackCWLAP, (void*)wifilist);
+    netsend_P(n, PSTR("<label>WiFi networks:</label><ul>"));
     char* token = strtok(wifilist, "\t");
     while (token != NULL) {
       buff[0] = 0;

      netsend(n, buff);
      token = strtok(NULL, "\t");
    }
    netsend_P(n, PSTR("</ul><form method='GET'><label>Connect to network:</label>"));
    netsend_P(n, PSTR("<input type='text' placeholder='network' name='n'/>"));
    netsend_P(n, PSTR("<input type='text' placeholder='password' name='p'/>"));
    netsend_P(n, PSTR("<input type='submit' value='Connect/Disconnect'/></form>"));

          //DEBUG_SERIAL.println("CWLAP char at");
          //DEBUG_SERIAL.println(i);
        }
      }
    }
  }
}

void callbackIP(char* line, void* context) {
  NParams* p = (NParams*)context;
  int o = 0;
  int max = 0;
  char* dst = NULL;
  if (memcmp_P(line, PSTR("+CWSAP_CUR:\""), 12)==0) {
    o = 12;
    max = MAX_APNAME;
    dst = p->APNAME;
  } else if (memcmp_P(line, PSTR("+CWJAP_CUR:\""), 12)==0) {
    o = 12;
    max = MAX_APNAME;
    dst = p->JAPNAME;
  } else if (memcmp_P(line, PSTR("+CIFSR:APIP,\""), 13)==0) {
    o = 13;
    max = 3*4+3+1;
    dst = p->APIP;
  } else if (memcmp_P(line, PSTR("+CIFSR:STAIP,\""), 14)==0) {
    o = 14;
    max = 3*4+3+1;
    dst = p->STAIP;
  }
  if (dst != NULL) {
    for (int i = o; i-o < max; i++) {
      if (line[i] == '"') {
        break;
      } else {
        dst[i-o]=line[i];
        dst[i-o+1]=0;
      }
    }
  }
