Skip to content

Commit

Permalink
fix esp8266 to match
Browse files Browse the repository at this point in the history
  • Loading branch information
brentru committed Jan 6, 2022
1 parent 4227671 commit 87a2962
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

# Doxygen
*.bak
html/*

# Clang-format Python Script
*.py
Expand Down
20 changes: 15 additions & 5 deletions src/network_interfaces/Wippersnapper_ESP8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,22 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
/**************************************************************************/
/*!
@brief Initializes the Adafruit IO class for ESP8266 devices.
@param aioUsername
Adafruit IO username
@param aioKey
Adafruit IO key
@param netSSID
Wireless Network SSID
@param netPass
Wireless Network password
*/
/**************************************************************************/
Wippersnapper_ESP8266() : Wippersnapper() {
_ssid = 0;
_pass = 0;
Wippersnapper_ESP8266(const char *aioUsername, const char *aioKey,
const char *netSSID, const char *netPass) : Wippersnapper() {
_ssid = netSSID;
_pass = netPass;
_username = aioUsername;
_key = aioKey;
_mqtt_client = new WiFiClientSecure;
_mqtt_client->setFingerprint(WS_SSL_FINGERPRINT);
}
Expand Down Expand Up @@ -107,8 +118,7 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
*/
/*******************************************************************/
void setupMQTTClient(const char *clientID) {
if (WS._mqttBrokerURL == nullptr)
WS._mqttBrokerURL = "io.adafruit.com";
WS._mqttBrokerURL = "io.adafruit.com";
WS._mqtt =
new Adafruit_MQTT_Client(_mqtt_client, WS._mqttBrokerURL, WS._mqtt_port,
clientID, WS._username, WS._key);
Expand Down
8 changes: 4 additions & 4 deletions src/network_interfaces/Wippersnapper_WIFININA.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ class Wippersnapper_WIFININA : public Wippersnapper {
Wippersnapper_WIFININA(const char *aioUsername, const char *aioKey,
const char *netSSID, const char *netPass)
: Wippersnapper() {
_wifi = &SPIWIFI;
_mqtt_client = new WiFiSSLClient;
WS._mqttBrokerURL = "io.adafruit.com";

_ssid = netSSID;
_pass = netPass;
_username = aioUsername;
_key = aioKey;

_wifi = &SPIWIFI;
_mqtt_client = new WiFiSSLClient;
WS._mqttBrokerURL = "io.adafruit.com";
}

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

0 comments on commit 87a2962

Please sign in to comment.