void connectAWS() { // Configure WiFiClientSecure to use the AWS IoT device credentials net.setCACert(AWS_CERT_CA); net.setCertificate(AWS_CERT_CRT); net.setPrivateKey(AWS_CERT_PRIVATE); // Connect to the MQTT broker on the AWS endpoint client.begin(AWS_IOT_ENDPOINT, 8883, net); Serial.println("Connecting to AWS IOT"); while (!client.connect(AWS_THING_NAME)) { Serial.print("."); delay(100); } Serial.println("AWS IoT Connected!"); }