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
void 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