diff --git a/src/network_interfaces/Wippersnapper_WIFININA.h b/src/network_interfaces/Wippersnapper_WIFININA.h index 3473cd6c1..b7eccac18 100644 --- a/src/network_interfaces/Wippersnapper_WIFININA.h +++ b/src/network_interfaces/Wippersnapper_WIFININA.h @@ -59,7 +59,7 @@ class Wippersnapper_WIFININA : public Wippersnapper { _wifi = &SPIWIFI; _mqtt_client = new WiFiSSLClient; - WS._mqttBrokerURL = "io.adafruit.com"; + // WS._mqttBrokerURL = "io.adafruit.com"; } /**************************************************************************/ @@ -193,9 +193,23 @@ class Wippersnapper_WIFININA : public Wippersnapper { */ /********************************************************/ void setupMQTTClient(const char *clientID) { - WS._mqtt = - new Adafruit_MQTT_Client(_mqtt_client, WS._mqttBrokerURL, WS._mqtt_port, - clientID, WS._username, WS._key); + u_int16_t port = 8883; + if (WS._mqttBrokerURL == nullptr) { + WS._mqttBrokerURL = "io.adafruit.com"; + // _mqtt_client->setCACert(_aio_root_ca_prod); + // } else if (WS._mqttBrokerURL == "io.adafruit.vm"){ + // // Set port to 1883 for non-ssl, or set SSL cert below + // //port = 1883; + // _mqtt_client->setCACert(_aio_root_ca_vm); + // } else if (WS._mqttBrokerURL == "io.adafruit.us") { + // _mqtt_client->setCACert(_aio_root_ca_staging); + // } else { + // // Assume non-ssl IP based testing + // port = 1883; + } + // Construct MQTT client + WS._mqtt = new Adafruit_MQTT_Client(_mqtt_client, WS._mqttBrokerURL, port, + clientID, WS._username, WS._key); } /********************************************************/