So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Hoka
#59690 @eduPerez
hi
yes you are right, sorry I copied and pasted an early version, the two buffers are 20 chars
and yes I did try a strip down version as below but the result is the same
Code: Select allvoid WifiConnect() {
  char ssbuff[20]; char pwbuff[20];
  ss2.toCharArray(ssbuff, ss2.length()+1);
  pw2.toCharArray(pwbuff, pw2.length()+1);
  WiFi.disconnect();
  while(WiFi.status() != WL_CONNECTED){
    Serial.print("Connecting To: "); Serial.println(String(ssbuff));
    WiFi.begin(ssbuff, pwbuff);
    while (WiFi.status() != WL_CONNECTED) {
      Serial.print("."); delay(500);
    }
  }
  Serial.println("WiFi connected");
  if(WiFi.status() == WL_CONNECTED) {
    client.setServer(serverIP, serverPort);  // server & port
    connectToMqtt();
  } else { Serial.println("Wifi connect Error"); }
}

thanks for the assistance
dave
User avatar
By AcmeUK
#59691 Does the Sky hub use different a different encryption (WEP, WPA, WPA2 etc) to the Thompson? See what your laptop connection tells you, otherwise log into each hub and look at the settings.

You could try running the following sketch https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino

This lists the SSID and encryption type of found networks.
Last edited by AcmeUK on Mon Dec 19, 2016 10:13 am, edited 1 time in total.
User avatar
By Hoka
#59692 that's a really good point, the sky hub uses WPA2-PSK but i'm really not sure what that means other than its access protection level 2 Pre shared key I have no idea about
The Thomson uses WPA-PSK it looks as though that might be the problem
can the 8266 encryption be changed ?? or even better be changed on the fly
User avatar
By AcmeUK
#59695 I do not know if the ESP encryption type can be changed. But a quick fix could be to change the Sky hub encryption to the same as the Thompson hub.