Skip to content

Commit

Permalink
Allow override of url for M4
Browse files Browse the repository at this point in the history
  • Loading branch information
tyeth committed Jan 5, 2024
1 parent 775ed42 commit 0271645
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/network_interfaces/Wippersnapper_WIFININA.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

/**************************************************************************/
Expand Down Expand Up @@ -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);
}

/********************************************************/
Expand Down

0 comments on commit 0271645

Please sign in to comment.