 
   tot = WiFi.scanNetworks();
   //set default AP
-  byte mac[6];
-  WiFi.macAddress(mac);
-  String apSSID = String(SSIDNAME) + "-" +  String(mac[3], HEX) + String(mac[4], HEX) + String(mac[5], HEX);
+  String mac = WiFi.macAddress();
+  String apSSID = String(SSIDNAME) + "-" + String(mac[9])+String(mac[10])+String(mac[12])+String(mac[13])+String(mac[15])+String(mac[16]);
   char softApssid[18];
-  //memset(softApssid,0,sizeof(softApssid));
   apSSID.toCharArray(softApssid, apSSID.length()+1);
   delay(1000);
   WiFi.softAP(softApssid);

  if( tmpHostname!="" )
    HOSTNAME = tmpHostname;
  // else
  //   HOSTNAME = apSSID;

    //Enable to start in AP+STA mode
   WiFi.mode(WIFI_AP_STA);

// uint8_t MAC_array[6];   //mac_address
// char macAddress[12];    //mac_address
String newSSID_param;
String newPASSWORD_param;
IPAddress default_IP(192,168,240,1);
