Closed skezo closed 5 years ago
Doing a bit more digging on this. The memory leak happens at any point no Google Home device is found. For example if you run the ghn.device(displayName)
once in the initial setup()
function using a displayName
that is not on the network the mDNS lookups (ESP8266mDNS.cpp/h
) will continue to search for it after the timeout from esp8266-google-home-notifier.cpp/h
.
Code sample:
...
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
Serial.println("connecting to Google Home...");
if (ghn.device(displayName, "en") != true) {
Serial.println(ghn.getLastError());
return;
}
Serial.print("found Google Home(");
}
void loop() {
}
...
The issue seems to be cause by GoogleHomeNotifier::device
repeating to call to MDNS.begin(hostString)
in ESP8266mDNS.cpp
.
Thanks!
Arduino IDE: 1.8.8 Arduino Core for ESP8266: 2.4.2 Board: LOLIN(WEMOS) D1 R2 & mini
Issue: Running out of heap when no Google Home is found
Steps to reproduce:
displayName
to on that cannot be foundghn.device
call will reduce the boards heap by 224 causing anException 29
error (see exception error below)Outputted error Exception 29: StoreProhibited: A store referenced a page mapped with an attribute that does not permit stores