Coder Social home page Coder Social logo

esp8266-google-home-notifier's Introduction

esp8266-google-home-notifier

Send notifications to Google Home from esp8266.

This library depends on Google Translate Service.

This is the Japanese document on Qiita.com;

Install

This library can be installed from the Library Manager on Arduino IDE

Requirement

  • Arduino board

    • esp8266 *Arduino Core ESP8266 2.x only
    • esp32
      (note: 1.0.2 and later, and 1.0.4 requires 83810fa or later of arduino-esp32)
  • esp8266-google-tts
    download from Library Manager of Arduino IDE

  • (only for ver 1.0.1 and earlier) Latest ESP8266mDNS

    • download ESP8266mDNS.cpp/.h to $LIBRARIES_DIR/esp8266-google-home-notifier/src/ and restart Arduino IDE, like below structure.
    $LIBRARIES_DIR
      └── esp8266-google-home-notifier/
          ├── LICENSE
          ├── README.md
          :
          └── src/
              ├── ESP8266mDNS.cpp  # <- additional file
              ├── ESP8266mDNS.h    # <- additional file
              :
              ├── esp8266-google-home-notifier.cpp
              └── esp8266-google-home-notifier.h
    

    or

Usage

Simple for esp8266/32

#ifdef ARDUINO_ARCH_ESP8266
#include <ESP8266WiFi.h>
#endif

#ifdef ARDUINO_ARCH_ESP32
#include <WiFi.h>
#endif
#include <esp8266-google-home-notifier.h>

const char* ssid     = "<REPLASE_YOUR_WIFI_SSID>";
const char* password = "<REPLASE_YOUR_WIFI_PASSWORD>";

GoogleHomeNotifier ghn;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("");
  Serial.print("connecting to Wi-Fi");
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(250);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("connected.");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());  //Print the local IP
  
  const char displayName[] = "Family Room";

  Serial.println("connecting to Google Home...");
  if (ghn.device(displayName, "en") != true) {
    Serial.println(ghn.getLastError());
    return;
  }
  Serial.print("found Google Home(");
  Serial.print(ghn.getIPAddress());
  Serial.print(":");
  Serial.print(ghn.getPort());
  Serial.println(")");
  
  if (ghn.notify("Hello, World!") != true) {
    Serial.println(ghn.getLastError());
    return;
  }
  Serial.println("Done.");
}

void loop() {
  // put your main code here, to run repeatedly:

}

Notification Server for esp8266

#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <esp8266-google-home-notifier.h>

const char* ssid     = "<REPLASE_YOUR_WIFI_SSID>";
const char* password = "<REPLASE_YOUR_WIFI_PASSWORD>";

ESP8266WebServer server(80);
GoogleHomeNotifier ghn;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("");
  Serial.print("connecting to Wi-Fi");
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(250);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("connected.");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());  //Print the local IP
  
  const char displayName[] = "Family Room";

  Serial.println("connecting to Google Home...");
  if (ghn.device(displayName, "en") != true) {
    Serial.println(ghn.getLastError());
    return;
  }
  Serial.print("found Google Home(");
  Serial.print(ghn.getIPAddress());
  Serial.print(":");
  Serial.print(ghn.getPort());
  Serial.println(")");
  
  server.on("/speech", handleSpeechPath);
  server.on("/", handleRootPath);
  server.begin();
 }

void handleSpeechPath() {
  String phrase = server.arg("phrase");
  if (phrase == "") {
    server.send(401, "text / plain", "query 'phrase' is not found");
    return;
  }
  if (ghn.notify(phrase.c_str()) != true) {
    Serial.println(ghn.getLastError());
    server.send(500, "text / plain", ghn.getLastError());
    return;
  }
  server.send(200, "text / plain", "OK");
}

void handleRootPath() {
  server.send(200, "text/html", "<html><head></head><body><input type=\"text\"><button>speech</button><script>var d = document;d.querySelector('button').addEventListener('click',function(){xhr = new XMLHttpRequest();xhr.open('GET','/speech?phrase='+encodeURIComponent(d.querySelector('input').value));xhr.send();});</script></body></html>");
}

void loop() {
  // put your main code here, to run repeatedly:
  server.handleClient();
}

esp8266-google-home-notifier's People

Contributors

cujomalainey avatar horihiro avatar ivankravets avatar mkttanabe avatar myuj avatar per1234 avatar skezo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp8266-google-home-notifier's Issues

language

Hello,
i don't find how to change the language of the phrase?
Thank you

ESP32 ERRORS...

Hello i'm using WEMOS LOL32 and and i got those errors:

esp8266-google-home-notifier.cpp: In member function 'boolean GoogleHomeNotifier::cast(const char*, const char*, WiFiClientSecure*)':
esp8266-google-home-notifier.cpp:86:9: error: 'TTS {aka class GoogleTTS}' has no member named 'setWiFiClientSecure'

tts.setWiFiClientSecure(m_client);

Thanks for your help!
Marc.

ESP8266mDNS.h declaration before esp8266-google-home-notifier.h causes compilation errors

Using git version of arduino-esp8266, Arduino IDE 1.8.5, Windows 10 x64.

Adding #include <ESP8266mDNS.h> before #include <esp8266-google-home-notifier.h> causes compilation issues. I'm guessing the internal ESP8266mDNS.h is interfering with this.

C:\Users\xxxx\Dropbox\Arduino\libraries\arduino_244670\src\esp8266-google-home-notifier.cpp: In member function 'boolean GoogleHomeNotifier::device(const char*, const char*, int)':

C:\Users\xxxx\Dropbox\Arduino\libraries\arduino_244670\src\esp8266-google-home-notifier.cpp:44:33: error: 'class MDNSResponder' has no member named 'txt'

           if (strcmp(name, MDNS.txt(i, "fn").c_str()) == 0) {

                                 ^

Multiple libraries were found for "ESP8266mDNS.h"
 Used: C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\libraries\ESP8266mDNS
 Not used: C:\Users\xxxx\Dropbox\Arduino\libraries\arduino_244670

Failed to Connect with ESP8266 Wemos D1 mini

Hi,
I am experiencing random connection problems between a Wemos D1 mini (Esp8266) and Google Home.
Most of time i've get this error : "Failed to Connect to 192.168.1.11:8009."

I've tried connecting with device name or ip, sending wav or TTS but it does not change anything.
I'm using the last version of ESP8266 (2.4.2) installed using Arduino IDE Boards Manager

Do you have any advice ?

Failed to get TKK

The Google Home device is located but I get the following error message: "Failed to get TKK". Nothing plays on the google home, not even a chime.

ESP8266 Example Compile Error

When attempting to compile the "Simple Usage" example for 8266 using Arduino IDE vision 1.8.16 I get this compile error:

/Users/prw/Documents/Arduino/libraries/esp8266-google-home-notifier/src/ESP8266mDNS.cpp: In member function 'MDNSTxt* MDNSResponder::_getServiceTxt(char*, char*)':
/Users/prw/Documents/Arduino/libraries/esp8266-google-home-notifier/src/ESP8266mDNS.cpp:569:42: error: cannot convert 'bool' to 'MDNSTxt*' in return
569 | if (servicePtr->_txts == 0) return false;
| ^~~~~
exit status 1
Error compiling for board LOLIN(WEMOS) D1 mini (clone).

If your device is named "Google Home" it will be ignored

If your device's name is Google Home calling GoogleHomeNotifier::device will ignore it.
This is caused by m_name being set as "Google Home" in esp8266-google-home-notifier.h and the strcmp(this->m_name, name) in GoogleHomeNotifier::device.

mDNS issues

Hello
I had mDNS issues.
What is the solution?

C:\Users\0123\Documents\Arduino\libraries\esp8266-google-home-notifier\src\esp8266-google-home-notifier.cpp:36:33: error: 'using MDNSResponder = class esp8266::MDNSImplementation::MDNSResponder' has no member named 'txt'
if (strcmp(name, MDNS.txt(i, "fn").c_str()) == 0) {
^
source code
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <ESP8266WiFi.h>
#include <esp8266-google-home-notifier.h>

#ifndef STASSID
#define STASSID "your-ssid"
#define STAPSK "your-password"
#endif

const char* ssid = STASSID;
const char* password = STAPSK;

GoogleHomeNotifier ghn;

void setup() {
Serial.begin(115200);
Serial.println("Booting");
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println("Connection Failed! Rebooting...");
delay(5000);
ESP.restart();
}

// Port defaults to 8266
// ArduinoOTA.setPort(8266);

// Hostname defaults to esp8266-[ChipID]
// ArduinoOTA.setHostname("myesp8266");

// No authentication by default
// ArduinoOTA.setPassword("admin");

// Password can be set with it's md5 value as well
// MD5(admin) = 21232f297a57a5a743894a0e4a801fc3
// ArduinoOTA.setPasswordHash("21232f297a57a5a743894a0e4a801fc3");

ArduinoOTA.onStart( {
String type;
if (ArduinoOTA.getCommand() == U_FLASH) {
type = "sketch";
} else { // U_FS
type = "filesystem";
}

// NOTE: if updating FS this would be the place to unmount FS using FS.end()
Serial.println("Start updating " + type);

});
ArduinoOTA.onEnd( {
Serial.println("\nEnd");
});
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
});
ArduinoOTA.onError([](ota_error_t error) {
Serial.printf("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR) {
Serial.println("Auth Failed");
} else if (error == OTA_BEGIN_ERROR) {
Serial.println("Begin Failed");
} else if (error == OTA_CONNECT_ERROR) {
Serial.println("Connect Failed");
} else if (error == OTA_RECEIVE_ERROR) {
Serial.println("Receive Failed");
} else if (error == OTA_END_ERROR) {
Serial.println("End Failed");
}
});
ArduinoOTA.begin();
Serial.println("Ready");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());

const char displayName[] = "Family Room";

Serial.println("connecting to Google Home...");
if (ghn.device(displayName, "en") != true) {
Serial.println(ghn.getLastError());
return;
}
Serial.print("found Google Home(");
Serial.print(ghn.getIPAddress());
Serial.print(":");
Serial.print(ghn.getPort());
Serial.println(")");

if (ghn.notify("Hello, World!") != true) {
Serial.println(ghn.getLastError());
return;
}
Serial.println("Done.");
}

void loop() {
ArduinoOTA.handle();
}

Many Google Devices and OOM Errors

If you have a large number of google devices on your network there are two issues:

  1. The mDNS query will fail because by default it will only wait 10 seconds for a response. Easily fixed, because there is already a timeout parameter to the device() function. For my network I had to increase it to 90 seconds.
  2. The mDNS response is large and is stored in RAM. With a moderatley large response, either the esp8266 will crash with an OOM exception, or it might work depending on when you get the TXT response you are looking for (i.e. we break out of the response processing loop sooner), or you will get a into a loop with a cryptic "Failed to Connect" error from BearSSL since it encounters an OOM exception.

For the second issue, since we really only call mDNS once and then save the IP and port results in memory, we can probably #define NO_GLOBAL_MDNS and use MDNSResponder locally in the device() function, once the function returns the local MDNS is destoyed and the RAM is reclaimed.

Thoughts?

Failed to get TKK

Had an ESP8266 project running for some while using the Google Home Notifier and Google TTS, but now stops after connecting with error:

Failed to get TKK - trying again.......
This repeats 10 times and then resets the cycle

Tried a new basic code installation using single word output, but does the same.
Have the latest .h files installed.
Any clues welcome

Can't push any notify to Google Home

Hi @horihiro

I just noticed that I can't push any notification to my Google Home Mini!
I receive the following code when triggering the notify method!
[E][WiFiClientSecure.cpp:127] connect(): start_ssl_client: -1
When I check the last error I get this
Failed to Connect to 192.168.1.128:8009.

It is a bit strange, the IP address is correct and this code previously worked on my setup.
I afraid if Google released a new update that changes the workflow.

System and cast firmware version of my Google Home are 229149 and 1.50.229.149

Can you please check if you have the same issue? or do you have access to any documentation on it?

Kind regards
Reza

IP address 0.0.0.0:0

Any suggestion?

connecting to Google Home...
found Google Home(0.0.0.0:0)
Google Home's IP address/port is not set. Call 'device' or 'ip' method before calling 'cast' method.

mDNS timeout.

i am getting mDNS timeout, is there a way to get the device name using the ip address.

ip 関数と play 関数についてのご相談

田辺と申します。6月に ESP32 への対応を完了されて以来、
esp8266-google-home-notifier を活用させて頂いております。
先日より二度に渡り貴ライブラリを題材に勤務先のブログにて
以下の記事を公開させて頂きました。宜しければお手すきの折にご笑覧下さい。
http://dsas.blog.klab.org/archives/2018-08/52297379.html
http://dsas.blog.klab.org/archives/2018-08/52297568.html

さて、手元では fork したライブラリコードをプライベートにカスタマイズして
扱っているのですが、もし今後改訂のご予定があれば、
オリジナルの google-home-notifier に存在する ip 関数と play 関数 (public) を
貴ライブラリへ加味して頂けないでしょうか?
デバイスの IP アドレスを固定可能な環境では ip 関数は有用ですし、
また、MP3 データのキャスト再生が可能であればさらに使途が広がるのではないかと
想像しております。
ご多忙のところ恐れ入りますが、おってご検討頂ければ幸いです。

Failed to get TKK. trying again...

Hi,
When trying to send Notification to Google assist I get

connecting to Wi-Fi...
connected.
IP address: 192.168.XXX.XXX
connecting to Google Home...
found Google Home(192.168.XXX.XXX:8009)
Failed to get TKK. trying again... (current: 0, maxRetry: 10)
Failed to get TKK. trying again... (current: 1, maxRetry: 10)

I have confirmed that I can get to Google Translate Service on the network. and the esp is able to get to the web. Any suggestions

Running out of heap when no Google Home is found

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:

  1. Add the sample code below to an ESP8266 board and connect to a network where no Google Home can be found or set the displayName to on that cannot be found
  2. Loop this continuously
  3. Every ghn.device call will reduce the boards heap by 224 causing an Exception 29 error (see exception error below)
#include <ESP8266WiFi.h>
#include <esp8266-google-home-notifier.h>

const char* ssid = "";
const char* password = "";
const char displayName[] = "";
GoogleHomeNotifier ghn;

void setup() {
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
  }
}

void findGoogleHome() {
  Serial.println("connecting to Google Home...");
  if (ghn.device(displayName, "en") != true) {
    Serial.println(ghn.getLastError());
    return;
  }
  Serial.print("found Google Home(");
}

void stats() {
  Serial.printf("Free: %d\n", ESP.getFreeHeap());
}

void loop() {
  findGoogleHome();
  stats();
  delay(5000);
}

Outputted error Exception 29: StoreProhibited: A store referenced a page mapped with an attribute that does not permit stores

Exception (29):
epc1=0x402031e9 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: sys 
sp: 3fffe9d0 end: 3fffffb0 offset: 01a0

>>>stack>>>
3fffeb70:  00000010 3fffbfe8 3fffbfe8 3fffbfe4  
3fffeb80:  00000010 3fffee3c 3fffee3c 40204ffb  
3fffeb90:  3fffecef 00000004 3fffee3c 40205047  
3fffeba0:  00000003 00000009 3fffee3c 3fffbfe4  
3fffebb0:  00000003 40205384 00000010 401004e8  
3fffebc0:  3fffecef 40203feb 00000010 40205384  
3fffebd0:  402041bf 00000004 3ffeedfc 40203ff0  
3fffebe0:  00000608 3ffe8ff7 baae1973 daf4b60e  
3fffebf0:  676f6f47 482d656c 2d656d6f 61356463  
3fffec00:  61393532 36366138 39656561 66643666  
3fffec10:  64316161 64323163 36616433 3ffef200  
3fffec20:  3ffef3ac 40212eec 00000008 401004e8  
3fffec30:  4020eef6 00000000 3fff01cc 40212eec  
3fffec40:  0000004c 00000000 00000001 4020c2d0  
3fffec50:  3ffef3b8 00000001 3fff01cc 4020c30c  
3fffec60:  3ffef3ac 00000000 3ffefcac 40211c7c  
3fffec70:  00000000 00000000 3fff01cc 00000001  
3fffec80:  00000005 00000000 00000020 40100f22  
3fffec90:  000005e0 00000000 40103125 3ffed540  
3fffeca0:  0000003c 00000000 3ffece50 00000100  
3fffecb0:  0000001c 00000001 4010426a 3ffed540  
3fffecc0:  3ffed510 1052f205 00000000 3ffed1b0  
3fffecd0:  00000005 00000000 00000020 40100f22  
3fffece0:  3ffe93c5 4010431f 3ffece50 6e000001  
3fffecf0:  00313d66 41434638 33443238 72003135  
3fffed00:  32370000 37444242 42433336 42313330  
3fffed10:  64004344 64323163 36616433 00000cc0  
3fffed20:  fffffff2 1332e350 4010224e 00000100  
3fffed30:  7fffffff 3ffe9c64 3ffe9c64 00000001  
3fffed40:  00000001 00006208 4010426a 3ffed540  
3fffed50:  00000000 1332e350 00000000 4000050c  
3fffed60:  3fffc278 40101fe8 3fffc200 00000022  
3fffed70:  3ffe9c70 3ffed540 3ffece50 3fffee90  
3fffed80:  4021b5d9 00000030 00000000 ffffffff  
3fffed90:  3ffed79c 000000b0 00000058 00000031  
3fffeda0:  00000031 3fffeee8 3fffeee8 00000000  
3fffedb0:  00000017 0000001d 00000019 00000080  
3fffedc0:  00000005 00000000 00000020 40100f22  
3fffedd0:  3ffe93c5 4010431f 3ffece50 42d80000  
3fffede0:  40101c3d 3ffece50 60000200 75000006  
3fffedf0:  fffffff2 1332e5a8 3ffed85c 40101e0e  
3fffee00:  3ffe9c70 00000000 00000000 6f6c9a00  
3fffee10:  006c6163 73616365 40100074 00000100  
3fffee20:  7fffffff 3ffe9c70 3ffe9c70 00000001  
3fffee30:  00008400 00000001 40230003 00000000  
3fffee40:  00000000 00000000 00000000 4010020c  
3fffee50:  3fffbfe4 00000002 00000001 00000000  
3fffee60:  3fffedf0 00000008 00000005 40212f00  
3fffee70:  40000000 00000030 00000018 3fffbcbc  
3fffee80:  3ffeedfc 3fffbc04 3ffefd34 402045ed  
3fffee90:  3ffef494 3fffbcee 3ffefd34 4020586b  
3fffeea0:  3ffef494 3fffbcee 3ffeff4c 40202eb4  
3fffeeb0:  0000018a 4010659c 3ffeff4c 4020f4c0  
3fffeec0:  00000000 000014e9 3ffef3ac 00000000  
3fffeed0:  00000000 40212eec 0000019c 3fffbcda  
3fffeee0:  3ffef3ac 3fffbcbc 3ffef494 40212668  
3fffeef0:  00000014 000018fe 000018fe 3ffef3ac  
3fffef00:  3fffdc80 3ffef954 3fffbca4 3ffef9ac  
3fffef10:  00000008 3ffef3ac 3fffbcbc 4020c1dc  
3fffef20:  3fffdc80 3ffef954 3fffbca4 4020c017  
3fffef30:  402291fa 3ffef954 3fffbca4 4022920b  
3fffef40:  3fffbccc 3fffbcbc 00000002 3fffdcb0  
3fffef50:  40224107 00000000 3fffbca4 4022b14b  
3fffef60:  40000f49 3fffdab0 3fffdab0 40000f49  
3fffef70:  40000e19 40001878 00000002 00000000  
3fffef80:  3fffff10 aa55aa55 0000003b 40104424  
3fffef90:  4010442a 00000002 00000000 b8c46543  
3fffefa0:  4010000d 3fffef3c 40100985 3ffffd78  
3fffefb0:  40100774 3fffef4c 40100721 3ffffe78  
3fffefc0:  3fffffd0 00000000 00000000 feefeffe  
3fffefd0:  feefeffe feefeffe feefeffe feefeffe  
3fffefe0:  feefeffe feefeffe feefeffe feefeffe  
3fffeff0:  feefeffe feefeffe feefeffe feefeffe  
3ffff000:  feefeffe feefeffe feefeffe feefeffe  
3ffff010:  feefeffe feefeffe feefeffe feefeffe  
3ffff020:  feefeffe feefeffe feefeffe feefeffe  
3ffff030:  feefeffe feefeffe feefeffe feefeffe  
3ffff040:  feefeffe feefeffe feefeffe feefeffe  
3ffff050:  feefeffe feefeffe feefeffe feefeffe  
3ffff060:  feefeffe feefeffe feefeffe feefeffe  
3ffff070:  feefeffe feefeffe feefeffe feefeffe  
3ffff080:  feefeffe feefeffe feefeffe feefeffe  
3ffff090:  feefeffe feefeffe feefeffe feefeffe  
3ffff0a0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0c0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0d0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0e0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0f0:  feefeffe feefeffe feefeffe feefeffe  
3ffff100:  feefeffe feefeffe feefeffe feefeffe  
3ffff110:  feefeffe feefeffe feefeffe feefeffe  
3ffff120:  feefeffe feefeffe feefeffe feefeffe  
3ffff130:  feefeffe feefeffe feefeffe feefeffe  
3ffff140:  feefeffe feefeffe feefeffe feefeffe  
3ffff150:  feefeffe feefeffe feefeffe feefeffe  
3ffff160:  feefeffe feefeffe feefeffe feefeffe  
3ffff170:  feefeffe feefeffe feefeffe feefeffe  
3ffff180:  feefeffe feefeffe feefeffe feefeffe  
3ffff190:  feefeffe feefeffe feefeffe feefeffe  
3ffff1a0:  feefeffe feefeffe feefeffe feefeffe  
3ffff1b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff1c0:  feefeffe feefeffe feefeffe feefeffe  
3ffff1d0:  feefeffe feefeffe feefeffe feefeffe  
3ffff1e0:  feefeffe feefeffe feefeffe feefeffe  
3ffff1f0:  feefeffe feefeffe feefeffe feefeffe  
3ffff200:  feefeffe feefeffe feefeffe feefeffe  
3ffff210:  feefeffe feefeffe feefeffe feefeffe  
3ffff220:  feefeffe feefeffe feefeffe feefeffe  
3ffff230:  feefeffe feefeffe feefeffe feefeffe  
3ffff240:  feefeffe feefeffe feefeffe feefeffe  
3ffff250:  feefeffe feefeffe feefeffe feefeffe  
3ffff260:  feefeffe feefeffe feefeffe feefeffe  
3ffff270:  feefeffe feefeffe feefeffe feefeffe  
3ffff280:  feefeffe feefeffe feefeffe feefeffe  
3ffff290:  feefeffe feefeffe feefeffe feefeffe  
3ffff2a0:  feefeffe feefeffe feefeffe feefeffe  
3ffff2b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff2c0:  feefeffe feefeffe feefeffe feefeffe  
3ffff2d0:  feefeffe feefeffe feefeffe feefeffe  
3ffff2e0:  feefeffe feefeffe feefeffe feefeffe  
3ffff2f0:  feefeffe feefeffe feefeffe feefeffe  
3ffff300:  feefeffe feefeffe feefeffe feefeffe  
3ffff310:  feefeffe feefeffe feefeffe feefeffe  
3ffff320:  feefeffe feefeffe feefeffe feefeffe  
3ffff330:  feefeffe feefeffe feefeffe feefeffe  
3ffff340:  feefeffe feefeffe feefeffe feefeffe  
3ffff350:  feefeffe feefeffe feefeffe feefeffe  
3ffff360:  feefeffe feefeffe feefeffe feefeffe  
3ffff370:  feefeffe feefeffe feefeffe feefeffe  
3ffff380:  feefeffe feefeffe feefeffe feefeffe  
3ffff390:  feefeffe feefeffe feefeffe feefeffe  
3ffff3a0:  feefeffe feefeffe feefeffe feefeffe  
3ffff3b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff3c0:  feefeffe feefeffe feefeffe feefeffe  
3ffff3d0:  feefeffe feefeffe feefeffe feefeffe  
3ffff3e0:  feefeffe feefeffe feefeffe feefeffe  
3ffff3f0:  feefeffe feefeffe feefeffe feefeffe  
3ffff400:  feefeffe feefeffe feefeffe feefeffe  
3ffff410:  feefeffe feefeffe feefeffe feefeffe  
3ffff420:  feefeffe feefeffe feefeffe feefeffe  
3ffff430:  feefeffe feefeffe feefeffe feefeffe  
3ffff440:  feefeffe feefeffe feefeffe feefeffe  
3ffff450:  feefeffe feefeffe feefeffe feefeffe  
3ffff460:  feefeffe feefeffe feefeffe feefeffe  
3ffff470:  feefeffe feefeffe feefeffe feefeffe  
3ffff480:  feefeffe feefeffe feefeffe feefeffe  
3ffff490:  feefeffe feefeffe feefeffe feefeffe  
3ffff4a0:  feefeffe feefeffe feefeffe feefeffe  
3ffff4b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff4c0:  feefeffe feefeffe feefeffe feefeffe  
3ffff4d0:  feefeffe feefeffe feefeffe feefeffe  
3ffff4e0:  feefeffe feefeffe feefeffe feefeffe  
3ffff4f0:  feefeffe feefeffe feefeffe feefeffe  
3ffff500:  feefeffe feefeffe feefeffe feefeffe  
3ffff510:  feefeffe feefeffe feefeffe feefeffe  
3ffff520:  feefeffe feefeffe feefeffe feefeffe  
3ffff530:  feefeffe feefeffe feefeffe feefeffe  
3ffff540:  feefeffe feefeffe feefeffe feefeffe  
3ffff550:  feefeffe feefeffe feefeffe feefeffe  
3ffff560:  feefeffe feefeffe feefeffe feefeffe  
3ffff570:  feefeffe feefeffe feefeffe feefeffe  
3ffff580:  feefeffe feefeffe feefeffe feefeffe  
3ffff590:  feefeffe feefeffe feefeffe feefeffe  
3ffff5a0:  feefeffe feefeffe feefeffe feefeffe  
3ffff5b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff5c0:  feefeffe feefeffe feefeffe feefeffe  
3ffff5d0:  feefeffe feefeffe feefeffe feefeffe  
3ffff5e0:  feefeffe feefeffe feefeffe feefeffe  
3ffff5f0:  feefeffe feefeffe feefeffe feefeffe  
3ffff600:  feefeffe feefeffe feefeffe feefeffe  
3ffff610:  feefeffe feefeffe feefeffe feefeffe  
3ffff620:  feefeffe feefeffe feefeffe feefeffe  
3ffff630:  feefeffe feefeffe feefeffe feefeffe  
3ffff640:  feefeffe feefeffe feefeffe feefeffe  
3ffff650:  feefeffe feefeffe feefeffe feefeffe  
3ffff660:  feefeffe feefeffe feefeffe feefeffe  
3ffff670:  feefeffe feefeffe feefeffe feefeffe  
3ffff680:  feefeffe feefeffe feefeffe feefeffe  
3ffff690:  feefeffe feefeffe feefeffe feefeffe  
3ffff6a0:  feefeffe feefeffe feefeffe feefeffe  
3ffff6b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff6c0:  feefeffe feefeffe feefeffe feefeffe  
3ffff6d0:  feefeffe feefeffe feefeffe feefeffe  
3ffff6e0:  feefeffe feefeffe feefeffe feefeffe  
3ffff6f0:  feefeffe feefeffe feefeffe feefeffe  
3ffff700:  feefeffe feefeffe feefeffe feefeffe  
3ffff710:  feefeffe feefeffe feefeffe feefeffe  
3ffff720:  feefeffe feefeffe feefeffe feefeffe  
3ffff730:  feefeffe feefeffe feefeffe feefeffe  
3ffff740:  feefeffe feefeffe feefeffe feefeffe  
3ffff750:  feefeffe feefeffe feefeffe feefeffe  
3ffff760:  feefeffe feefeffe feefeffe feefeffe  
3ffff770:  feefeffe feefeffe feefeffe feefeffe  
3ffff780:  feefeffe feefeffe feefeffe feefeffe  
3ffff790:  feefeffe feefeffe feefeffe feefeffe  
3ffff7a0:  feefeffe feefeffe feefeffe feefeffe  
3ffff7b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff7c0:  feefeffe feefeffe feefeffe feefeffe  
3ffff7d0:  feefeffe feefeffe feefeffe feefeffe  
3ffff7e0:  feefeffe feefeffe feefeffe feefeffe  
3ffff7f0:  feefeffe feefeffe feefeffe feefeffe  
3ffff800:  feefeffe feefeffe feefeffe feefeffe  
3ffff810:  feefeffe feefeffe feefeffe feefeffe  
3ffff820:  feefeffe feefeffe feefeffe feefeffe  
3ffff830:  feefeffe feefeffe feefeffe feefeffe  
3ffff840:  feefeffe feefeffe feefeffe feefeffe  
3ffff850:  feefeffe feefeffe feefeffe feefeffe  
3ffff860:  feefeffe feefeffe feefeffe feefeffe  
3ffff870:  feefeffe feefeffe feefeffe feefeffe  
3ffff880:  feefeffe feefeffe feefeffe feefeffe  
3ffff890:  feefeffe feefeffe feefeffe feefeffe  
3ffff8a0:  feefeffe feefeffe feefeffe feefeffe  
3ffff8b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff8c0:  feefeffe feefeffe feefeffe feefeffe  
3ffff8d0:  feefeffe feefeffe feefeffe feefeffe  
3ffff8e0:  feefeffe feefeffe feefeffe feefeffe  
3ffff8f0:  feefeffe feefeffe feefeffe feefeffe  
3ffff900:  feefeffe feefeffe feefeffe feefeffe  
3ffff910:  feefeffe feefeffe feefeffe feefeffe  
3ffff920:  feefeffe feefeffe feefeffe feefeffe  
3ffff930:  feefeffe feefeffe feefeffe feefeffe  
3ffff940:  feefeffe feefeffe feefeffe feefeffe  
3ffff950:  feefeffe feefeffe feefeffe feefeffe  
3ffff960:  feefeffe feefeffe feefeffe feefeffe  
3ffff970:  feefeffe feefeffe feefeffe feefeffe  
3ffff980:  feefeffe feefeffe feefeffe feefeffe  
3ffff990:  feefeffe feefeffe feefeffe feefeffe  
3ffff9a0:  feefeffe feefeffe feefeffe feefeffe  
3ffff9b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff9c0:  feefeffe feefeffe feefeffe feefeffe  
3ffff9d0:  feefeffe feefeffe feefeffe feefeffe  
3ffff9e0:  feefeffe feefeffe feefeffe feefeffe  
3ffff9f0:  feefeffe feefeffe feefeffe feefeffe  
3ffffa00:  feefeffe feefeffe feefeffe feefeffe  
3ffffa10:  feefeffe feefeffe feefeffe feefeffe  
3ffffa20:  feefeffe feefeffe feefeffe feefeffe  
3ffffa30:  feefeffe feefeffe feefeffe feefeffe  
3ffffa40:  feefeffe feefeffe feefeffe feefeffe  
3ffffa50:  feefeffe feefeffe feefeffe feefeffe  
3ffffa60:  feefeffe feefeffe feefeffe feefeffe  
3ffffa70:  feefeffe feefeffe feefeffe feefeffe  
3ffffa80:  feefeffe feefeffe feefeffe feefeffe  
3ffffa90:  feefeffe feefeffe feefeffe feefeffe  
3ffffaa0:  feefeffe feefeffe feefeffe feefeffe  
3ffffab0:  feefeffe feefeffe feefeffe feefeffe  
3ffffac0:  feefeffe feefeffe feefeffe feefeffe  
3ffffad0:  feefeffe feefeffe feefeffe feefeffe  
3ffffae0:  feefeffe feefeffe feefeffe feefeffe  
3ffffaf0:  feefeffe feefeffe feefeffe feefeffe  
3ffffb00:  00000005 00000000 00000020 40100f22  
3ffffb10:  3ffe93c5 4010431f 3ffece28 feefeffe  
3ffffb20:  40101c3d 3ffece28 feefeffe feefeffe  
3ffffb30:  fffffff2 0b614e46 3ffed85c 40101e0e  
3ffffb40:  3ffe9c70 00000000 00000000 feefeffe  
3ffffb50:  fffffff2 0b614e46 4010224e 00000100  
3ffffb60:  7fffffff 3ffe9c70 3ffe9c70 00000001  
3ffffb70:  00000001 00000080 00000000 ffffffff  
3ffffb80:  40225250 0b614e46 00000000 4000050c  
3ffffb90:  00000000 00000000 0000001f 40104bfd  
3ffffba0:  4000050c 00000000 0000001f 40104bfd  
3ffffbb0:  40000f83 00000030 00000000 ffffffff  
3ffffbc0:  4022430a 00000023 000c0240 7a800000  
3ffffbd0:  00000001 3ffed91c 00000000 00000000  
3ffffbe0:  ff000fff 00ffffff 00000060 3ffecb30  
3ffffbf0:  3ffef58c 00000001 3fff0140 00000030  
3ffffc00:  402175a4 3ffef954 3fff0140 4010498c  
3ffffc10:  00000052 3ffef954 0000007f 00000003  
3ffffc20:  00000001 fffffffd 00000001 3fff0140  
3ffffc30:  3ffef954 3fff8424 3fff0140 00000030  
3ffffc40:  00000000 00000000 0000001f 40104bfd  
3ffffc50:  4000050c 4020a20c 40225267 00000001  
3ffffc60:  ffffffff 00000000 3ffe9511 00000008  
3ffffc70:  00000001 00000000 00000014 40228ddb  
3ffffc80:  4022539a 3ffecb30 4010106b 3ffecb30  
3ffffc90:  00000014 3fff0140 00000008 3fffbef4  
3ffffca0:  40224324 3ffecb30 3ffed2b0 3fff0140  
3ffffcb0:  00000000 402177e3 3ffee110 3ffffe50  
3ffffcc0:  00000000 00000002 00000001 3ffecb30  
3ffffcd0:  3fffbf0e 401049a3 3fff0140 3ffef954  
3ffffce0:  3fffbecc 3ffeff50 00000008 00000000  
3ffffcf0:  00000005 4020bb85 3ffeefcc 3ffef954  
3ffffd00:  3fffbf0e 00000052 3ffece28 00000030  
3ffffd10:  40101c3d 3ffece28 40225267 3ffef3e1  
3ffffd20:  3ffef3ac 3ffef3ac 3fffbecc 4020beda  
3ffffd30:  4020c273 3fffbecc 3fffbf0e 4020c27c  
3ffffd40:  00000008 3ffffd70 4010224e 4020a20c  
3ffffd50:  3ffffe80 3ffe8304 3ffffde0 3fffbf1c  
3ffffd60:  3fffbecc 3ffeff50 3ffef3ac 40211df5  
3ffffd70:  005e0001 0000fb00 0000000a 3ffffde0  
3ffffd80:  00000014 3ffeff50 3fffbecc 4021287c  
3ffffd90:  00000006 00000000 0000001f 3ffe893b  
3ffffda0:  3ffef3b0 00000001 00000000 00000011  
3ffffdb0:  3ffef34c 3ffe89c9 ffffffff 00000000  
3ffffdc0:  00000011 00000001 3f302064 3fffbecc  
3ffffdd0:  3ffeff50 3fffbf30 3ffeff4c 4021290a  
3ffffde0:  3ffef3ac 00000000 00000000 40212fdb  
3ffffdf0:  00000006 0000000a 3f302058 4020f717  
3ffffe00:  3ffef3ac 00001968 00000000 3fffb730  
3ffffe10:  3fffbecc 3ffef3ac 3ffef3b0 000014e9  
3ffffe20:  0000005a 40212eec 00000094 401004e8  
3ffffe30:  3ffeefa8 00001925 00001925 00000000  
3ffffe40:  3ffeff50 000014e9 3ffeff4c 4020f784  
3ffffe50:  fffffffc 00000001 3fffbbbc 4020f7f8  
3ffffe60:  40104d40 05e9cbbb 3ffeef84 00000000  
3ffffe70:  3ffee680 3ffeef84 3ffe8508 3ffeef84  
3ffffe80:  00000002 3ffffec0 402054d8 3fffefb0  
3ffffe90:  3ffeef84 00000002 000003e8 4020155b  
3ffffea0:  00000001 00000001 3ffeedfc 4020356d  
3ffffeb0:  6f6f675f 63656c67 00747361 40203424  
3ffffec0:  00000000 00000100 00000000 d402a8c0  
3ffffed0:  00ffffff 0102a8c0 61636f6c 745f006c  
3ffffee0:  00007063 3f01000c 00000005 00000004  
3ffffef0:  0000000b 005f0000 3ffeedfc 402048be  
3fffff00:  3ffffeb0 00000001 40202f60 402047e8  
3fffff10:  00000000 00000000 0000049c 3ffeef30  
3fffff20:  3ffeedfc 00000000 3ffeec58 40204994  
3fffff30:  5f505345 31463731 00004637 3ffeef30  
3fffff40:  3fffdad0 0000001c 3ffeee70 40204ad4  
3fffff50:  3fffdad0 00000000 3ffeee70 40204cdd  
3fffff60:  3ffe8950 3ffeecd0 0004e858 3ffe891d  
3fffff70:  000001f4 3ffeef84 3ffeee70 40204dcc  
3fffff80:  3fffdad0 3ffeef30 3ffeee70 3ffeef30  
3fffff90:  3fffdad0 3ffeec58 3ffeee70 40202545  
3fffffa0:  00000000 00000000 3ffeef28 402025a1  
<<<stack<<<

last failed alloc call: 40203FEB(16)

 ets Jan  8 2013,rst cause:2, boot mode:(1,6)


 ets Jan  8 2013,rst cause:4, boot mode:(1,6)

wdt reset

Add dependency on mDNS rather than bundling it

Hello! Thank you for putting this library together!

I noticed that the library bundles in ESP8266mDNS dependency, rather than requesting it to be installed separately at specific version.

the outcome is that any project that would depend on both mDNS and notifier spots and reports a conflict that cannot be easily resolved.

It would be great if the library used __has_include feature (confirmed to work) (https://en.cppreference.com/w/cpp/feature_test) to report missing dependency, eg.

#ifdef __has_include
#  if !__has_include(<ESP8266mDNS.h>)
#    error Please use package manager to install ESP8266mDNS at version X
#  endif
#endif

Failed to Connect to Google Home Mini

Using the Simple for esp8266/32 sketch (SimpleUsage) example, I am trying to have 8266 to make a "hello world" announcement on my google mini home and it works just fine,

When I try to call this as a function I receive the failed to connect error as shown below;

21:58:26.194 -> .
21:58:26.194 -> connected.
21:58:26.194 -> IP address: 192.168.1.93
21:58:26.194 -> connecting to Google Home...
21:58:27.211 -> found Google Home(192.168.1.79:8009)
21:58:27.326 -> Failed to Connect to 192.168.1.79:8009.
21:58:27.326 -> *WM: freeing allocated params!

Both 8266 and the google home mini are connected to the same WiFi. I can play music on the google home mini through google home app so I know google home mini is connected

Anyone any idea why this is still failing?

Below is the information about the google home mini

System firmware version: 250118
Cast firmware version: 1.54.250118
IP Address: 192.168.1.79

And below is my method;

void GoogleHomeInterraction(){

GoogleHomeNotifier ghn; /// tried both within the method and outside of the method

WiFi.mode(WIFI_STA);
WiFi.begin();

while (WiFi.status() != WL_CONNECTED) {
delay(250);
Serial.print(".");
}
Serial.println("");
Serial.println("connected.");
Serial.print("IP address: ");
Serial.println(WiFi.localIP()); //Print the local IP

const char displayName[] = "Family Room speaker";

Serial.println("connecting to Google Home...");
if (ghn.device(displayName, "en") != true) {
Serial.println(ghn.getLastError());
return;
}
Serial.print("found Google Home(");
Serial.print(ghn.getIPAddress());
Serial.print(":");
Serial.print(ghn.getPort());
Serial.println(")");

if (ghn.notify("Hello, World!") != true) {
Serial.println(ghn.getLastError());
return;
}
Serial.println("Done.");
}

Does notifier require a Chromecast device?

I have been unable to get notifier to speak through my Google Home Miini on my lan. The sketch finds the Mini, but always comes back with a "Failed to Connect to ........." message repeating the correct IP and port. Looking at the code, it seems to use the castMessage for the proto buffer. I am a rank neophyte in all this, but this seems to suggest that a Chromecast device must also be on the local lan, which I do not have. Is this true?

announcement does not work

Hello;

Couple days ago, all of a sudden my google home mini stopped doing the announcements. It only does the beep sound but would not announce "Hello World!"

I am using the example sketch (SimpleUsage) and below is the google home mini system information. Is this library still working for you? Maybe the Google translation services is not working?

System firmware version: 250118
Cast firmware version: 1.54.250118
IP Address: 192.168.1.79

Below is the console log from 8266

21:41:44.431 -> connecting to Google Home...
21:41:45.414 -> found Google Home(192.168.1.79:8009)
21:41:46.770 -> Done.

Please Help

Hi

I´m using arduino IDE 1.8.8 and Esp8266 2.5 core

In your Library I deleted ESP8266mDNS.cpp and ESP8266mDNS.h

in your sample esp8266>NotificationServer I have these first 4 lines

#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <esp8266-google-home-notifier.h>
#include <ESP8266mDNS.h>

When I try to compile to my board Nodemcu 1.0 I got this error:

C:\Users\MarceloLG\Documents\ARDUINO-VARIOS\Arduino\libraries\esp8266-google-home-notifier\src\esp8266-google-home-notifier.cpp: In member function 'boolean GoogleHomeNotifier::device(const char, const char, int)':

C:\Users\MarceloLG\Documents\ARDUINO-VARIOS\Arduino\libraries\esp8266-google-home-notifier\src\esp8266-google-home-notifier.cpp:33:33: error: 'using MDNSResponder = class esp8266::MDNSImplementation::MDNSResponder' has no member named 'txt'

       if (strcmp(name, MDNS.txt(i, "fn").c_str()) == 0) {

                             ^

exit status 1
Erro compilando para a placa NodeMCU 1.0 (ESP-12E Module)**

Can you help me please ?

Thanks so much

Doorbell button press

I have it working with this Code here.

I would just like to add all my google home's in. So this way it send's it to all devices.

Code I am using is.
#include <ESP8266WiFi.h>
#include <Bounce2.h> // https://github.com/thomasfredericks/Bounce2
#include <esp8266-google-home-notifier.h> // https://github.com/horihiro/esp8266-google-home-notifier
// https://github.com/horihiro/esp8266-google-tts

#define BUTTON_PIN D2 // D2/GPIO4

const char* ssid = "xxx";
const char* password = "xxx";

Bounce debouncer = Bounce();
GoogleHomeNotifier ghn;

void setup() {

// Setup the button with an internal pull-up :
pinMode(BUTTON_PIN,INPUT_PULLUP);

// After setting up the button, setup the Bounce instance :
debouncer.attach(BUTTON_PIN);
debouncer.interval(5); // interval in ms

Serial.begin(115200);
Serial.println("");
Serial.print("connecting to Wi-Fi");
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(250);
Serial.print(".");
}
Serial.println("");
Serial.println("connected.");
Serial.print("IP address: ");
Serial.println(WiFi.localIP()); //Print the local IP

const char displayName[] = "Devin"; /// Change this, must match the name of Google Home

Serial.println("connecting to Google Home...");
if (ghn.device(displayName, "en") != true) {
Serial.println(ghn.getLastError());
return;
}
Serial.print("found Google Home(");
Serial.print(ghn.getIPAddress());
Serial.print(":");
Serial.print(ghn.getPort());
Serial.println(")");
}

void loop() {
debouncer.update();
if ( debouncer.fell() ) {
if (ghn.notify("Someone is at the door!") != true) {
Serial.println(ghn.getLastError());
return;
}
}
}

Possible fix for ESP32 not working.

@hirohiro; @razaaneam; @brennonmessana
Hi,
I want to complement horihiro on what for me turns out to be a much needed valuable library. As a previous question suggested, I struggled and failed to get an ESP32 to send a message to my Google Home Mini. I could see the call to Google translate was working, but like, others, I came up with "failed to connect to 1.92.168.1.3:8009. The ip address and port identified were correct. Being a neophyte in understanding wired and wireless connections did not help. Based on comments by other posters. I think I finally fixed my issue, but the fix is different than their changes suggest.
Conditions:
Google Home Mini: Cast firmware 1.54.250118; System firmware version 250118,
ESP32: MeLife ESP32, Aruduino IDE Board: ESP32 Dev Module.
notifier tts version is 1.1.0 and notifier version: 1.07.

What I did is add another compiler directive as a test case. Starting at line 110 in esp8266-google-home-notifier.cpp. my code reads:

#if defined(ARDUINO_ARCH_ESP8266) && !defined(ARDUINO_ESP8266_RELEASE_BEFORE_THAN_2_5_0)
m_client->setInsecure();
#endif
#ifdef ARDUINO_ARCH_ESP32
m_client->setInsecure();
#else
#error "ARDUINO_ARCH_ESP32 change went weird."
#endif

The first 3 lines are part of the original code. With this change, I finally was able to get the Mini to announce my text message. Why declaring the ESP32 client as insecure is necessary, is beyond my current understanding, although I would certainly like to understand why.
As an aside: The desperation to find a solution stems from developing a simple sketch to create an alert. Our house sump pump has a float that on rare occasions fails to trigger the pump, potentially leading to basement flooding. There is no way to create an audio alert through the Google Home Mini using Google Assistant or AWS Alexa that I was able to find.

Notification sound mixed with speech

Hi Horihiro,

Thanks for a great scipt for ESP8266, it works really well.

I have just one question. When the speech is beeing announced on the Google Home Nest speaker, there is a notification sound that is played at the same time as the speech.

Is it possible to disable this notification sound or just to put in a delay for 1 second or 2 ?

https://wetransfer.com/downloads/552068e028807f7cfe9f64df67fcdcfa20201008205335/e324ac377188ec06083d9128d400aa4220201008205438/13ed8d

I have all ready disabled the notification sound in the google home app, but when I use your script, it still send another notification sound while it speaks.

Hoping to her from you.

Best regards
Morten

mDNS timeout.

Hello,
i own 5 google home speaker and all up and running but
It does not matter what google home name I enter, I only get this error

connecting to Wi-Fi.
connected.
IP address: *92.*68.*88.*84
connecting to Google Home...
mDNS timeout.

can you help me ?

Arduino-ESP32 のコンパイルエラー

mgo-tec と申します。

今日初めて使わせていただきましたが、コンパイルが通りませんでした。
ESP32-DevKitC と M5Stack でも同じエラーです。

esp8266-google-home-notifier.cpp:28:41: error: format '%X' expects argument of type 'unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Werror=format=]

esp8266-google-home-notifier.cpp:243:50: error: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Werror=format=]

とりあえず、以下のように修正してみたら、コンパイルが通って動作確認できました。
これが正しいのかは良く分かりません。

line 20:
long unsigned int chipid;

line 28:
sprintf(hostString, "ESP_%06lX", chipid);

line 243:
sprintf(this->m_clientid, "client-%ld", millis());

Google Home が自発的に喋ったのには感動しました。
素晴らしいです。
ありがとうございます。

Anyone interested in additional cast commands? e.g. setVolume, pause, stop, seek, getStatus

Thanks @horihiro for this amazing library! Was modifying this library for my esp8266 jukebox. Just wondering if anyone is interested in additional commands as described in
https://developers.google.com/cast/docs/reference/messages#MediaComm

I think I have added setVolume(), pause(), play() (aka. continue), stop(), seek() and status().

It is backward compatible but It is also heavily refactored.
master...geekahertz:feature/add-new-commands

Let me know if I should request a PR or just keep this to myself. Thanks!
G

NefryBT(esp32)でのビルドエラー

Nefryライブラリ1.2.2です。

Arduino:1.8.5 (Mac OS X), ボード:"Nefry BT R2 / R3, 921600, None"

ビルドオプションが変更されました。全体をリビルドしています。
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In function 'void _on_sys_event(system_event_t*)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:48:41: error: 'mdns_handle_system_event' was not declared in this scope
     mdns_handle_system_event(NULL, event);
                                         ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'bool MDNSResponder::begin(const char*)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:57:18: error: too few arguments to function 'esp_err_t mdns_init(tcpip_adapter_if_t, mdns_server_t**)'
     if(mdns_init()){
                  ^
In file included from /Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.h:46:0,
                 from /Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:42:
/Users/n0bisuke/Library/Arduino15/packages/Nefry(ESP32)/hardware/esp32/1.2.2/tools/sdk/include/mdns/mdns.h:59:11: note: declared here
 esp_err_t mdns_init(tcpip_adapter_if_t tcpip_if, mdns_server_t ** server);

           ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:61:31: error: invalid conversion from 'void (*)(system_event_t*)' to 'WiFiEventCb {aka void (*)(system_event_id_t)}' [-fpermissive]
     WiFi.onEvent(_on_sys_event);
                               ^
In file included from /Users/n0bisuke/Library/Arduino15/packages/Nefry(ESP32)/hardware/esp32/1.2.2/libraries/WiFi/src/WiFiSTA.h:28:0,
                 from /Users/n0bisuke/Library/Arduino15/packages/Nefry(ESP32)/hardware/esp32/1.2.2/libraries/WiFi/src/WiFi.h:32,
                 from /Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:43:
/Users/n0bisuke/Library/Arduino15/packages/Nefry(ESP32)/hardware/esp32/1.2.2/libraries/WiFi/src/WiFiGeneric.h:43:10: note:   initializing argument 1 of 'void WiFiGenericClass::onEvent(WiFiEventCb, system_event_id_t)'
     void onEvent(WiFiEventCb cbEvent, system_event_id_t event = SYSTEM_EVENT_MAX);

          ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:64:34: error: 'mdns_hostname_set' was not declared in this scope
     if(mdns_hostname_set(hostName)) {
                                  ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'void MDNSResponder::end()':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:72:15: error: too few arguments to function 'void mdns_free(mdns_server_t*)'
     mdns_free();
               ^
In file included from /Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.h:46:0,
                 from /Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:42:
/Users/n0bisuke/Library/Arduino15/packages/Nefry(ESP32)/hardware/esp32/1.2.2/tools/sdk/include/mdns/mdns.h:67:6: note: declared here
 void mdns_free(mdns_server_t * server);

      ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'void MDNSResponder::setInstanceName(String)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:77:43: error: 'mdns_instance_name_set' was not declared in this scope
     if(mdns_instance_name_set(name.c_str())){
                                           ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'void MDNSResponder::enableArduino(uint16_t, bool)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:85:5: error: 'mdns_txt_item_t' was not declared in this scope
     mdns_txt_item_t arduTxtData[4] = {
     ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:92:57: error: 'arduTxtData' was not declared in this scope
     if(mdns_service_add(NULL, "_arduino", "_tcp", port, arduTxtData, 4)) {
                                                         ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:96:82: error: 'mdns_service_txt_item_set' was not declared in this scope
     if(auth && mdns_service_txt_item_set("_arduino", "_tcp", "auth_upload", "yes")){
                                                                                  ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'void MDNSResponder::disableArduino()':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:102:46: error: cannot convert 'const char*' to 'mdns_server_t* {aka mdns_server_s*}' for argument '1' to 'esp_err_t mdns_service_remove(mdns_server_t*, const char*, const char*)'
     if(mdns_service_remove("_arduino", "_tcp")) {
                                              ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'void MDNSResponder::enableWorkstation(wifi_interface_t)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:113:65: error: too many arguments to function 'esp_err_t mdns_service_add(mdns_server_t*, const char*, const char*, uint16_t)'
     if(mdns_service_add(NULL, "_workstation", "_tcp", 9, NULL, 0)) {
                                                                 ^
In file included from /Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.h:46:0,
                 from /Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:42:
「WiFi.h」に対して複数のライブラリが見つかりました
使用済:/Users/n0bisuke/Library/Arduino15/packages/Nefry(ESP32)/hardware/esp32/1.2.2/libraries/WiFi
未使用:/Applications/Arduino.app/Contents/Java/libraries/WiFi
/Users/n0bisuke/Library/Arduino15/packages/Nefry(ESP32)/hardware/esp32/1.2.2/tools/sdk/include/mdns/mdns.h:108:11: note: declared here
 esp_err_t mdns_service_add(mdns_server_t * server, const char * service, const char * proto, uint16_t port);

           ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:115:79: error: 'mdns_service_instance_name_set' was not declared in this scope
     } else if(mdns_service_instance_name_set("_workstation", "_tcp", winstance)) {
                                                                               ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'void MDNSResponder::disableWorkstation()':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:121:50: error: cannot convert 'const char*' to 'mdns_server_t* {aka mdns_server_s*}' for argument '1' to 'esp_err_t mdns_service_remove(mdns_server_t*, const char*, const char*)'
     if(mdns_service_remove("_workstation", "_tcp")) {
                                                  ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'void MDNSResponder::addService(char*, char*, uint16_t)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:140:59: error: too many arguments to function 'esp_err_t mdns_service_add(mdns_server_t*, const char*, const char*, uint16_t)'
     if(mdns_service_add(NULL, _name, _proto, port, NULL, 0)) {
                                                           ^
In file included from /Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.h:46:0,
                 from /Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:42:
/Users/n0bisuke/Library/Arduino15/packages/Nefry(ESP32)/hardware/esp32/1.2.2/tools/sdk/include/mdns/mdns.h:108:11: note: declared here
 esp_err_t mdns_service_add(mdns_server_t * server, const char * service, const char * proto, uint16_t port);

           ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'bool MDNSResponder::addServiceTxt(char*, char*, char*, char*)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:159:59: error: 'mdns_service_txt_item_set' was not declared in this scope
     if(mdns_service_txt_item_set(_name, _proto, key, value)) {
                                                           ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'IPAddress MDNSResponder::queryHost(char*, uint32_t)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:170:55: error: 'mdns_query_a' was not declared in this scope
     esp_err_t err = mdns_query_a(host, timeout,  &addr);
                                                       ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'int MDNSResponder::queryService(char*, char*)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:190:40: error: 'mdns_query_results_free' was not declared in this scope
         mdns_query_results_free(results);
                                        ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:207:65: error: 'mdns_query_ptr' was not declared in this scope
     esp_err_t err = mdns_query_ptr(srv, prt, 3000, 20,  &results);
                                                                 ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:221:16: error: invalid conversion from 'const mdns_result_s*' to 'mdns_result_t* {aka mdns_result_s*}' [-fpermissive]
         r = r->next;
                ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'mdns_result_t* MDNSResponder::_getResult(int)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:234:26: error: invalid conversion from 'const mdns_result_s*' to 'mdns_result_t* {aka mdns_result_s*}' [-fpermissive]
         result = result->next;
                          ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'String MDNSResponder::hostname(int)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:245:27: error: 'mdns_result_t {aka struct mdns_result_s}' has no member named 'hostname'
     return String(result->hostname);
                           ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'IPAddress MDNSResponder::IP(int)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:254:5: error: 'mdns_ip_addr_t' was not declared in this scope
     mdns_ip_addr_t * addr = result->addr;
     ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:254:22: error: 'addr' was not declared in this scope
     mdns_ip_addr_t * addr = result->addr;
                      ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:256:31: error: 'MDNS_IP_PROTOCOL_V4' was not declared in this scope
         if(addr->addr.type == MDNS_IP_PROTOCOL_V4){
                               ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'IPv6Address MDNSResponder::IPv6(int)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:270:5: error: 'mdns_ip_addr_t' was not declared in this scope
     mdns_ip_addr_t * addr = result->addr;
     ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:270:22: error: 'addr' was not declared in this scope
     mdns_ip_addr_t * addr = result->addr;
                      ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:272:31: error: 'MDNS_IP_PROTOCOL_V6' was not declared in this scope
         if(addr->addr.type == MDNS_IP_PROTOCOL_V6){
                               ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'int MDNSResponder::numTxt(int)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:295:20: error: 'mdns_result_t {aka struct mdns_result_s}' has no member named 'txt_count'
     return result->txt_count;
                    ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'bool MDNSResponder::hasTxt(int, const char*)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:305:23: error: 'mdns_result_t {aka struct mdns_result_s}' has no member named 'txt_count'
     while(i < result->txt_count) {
                       ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:306:35: error: request for member 'key' in '*(result->mdns_result_s::txt + ((sizetype)i))', which is of non-class type 'const char'
         if (strcmp(result->txt[i].key, key) == 0) return true;
                                   ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'String MDNSResponder::txt(int, const char*)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:319:23: error: 'mdns_result_t {aka struct mdns_result_s}' has no member named 'txt_count'
     while(i < result->txt_count) {
                       ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:320:35: error: request for member 'key' in '*(result->mdns_result_s::txt + ((sizetype)i))', which is of non-class type 'const char'
         if (strcmp(result->txt[i].key, key) == 0) return result->txt[i].value;
                                   ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:320:73: error: request for member 'value' in '*(result->mdns_result_s::txt + ((sizetype)i))', which is of non-class type 'const char'
         if (strcmp(result->txt[i].key, key) == 0) return result->txt[i].value;
                                                                         ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp: In member function 'String MDNSResponder::txt(int, int)':
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:332:27: error: 'mdns_result_t {aka struct mdns_result_s}' has no member named 'txt_count'
     if (txtIdx >= result->txt_count) return "";
                           ^
/Users/n0bisuke/dotstudio/Arduino/libraries/esp8266-google-home-notifier/src/ESPmDNS.cpp:333:32: error: request for member 'value' in '*(result->mdns_result_s::txt + ((sizetype)txtIdx))', which is of non-class type 'const char'
     return result->txt[txtIdx].value;
                                ^
exit status 1
ボードNefry BT R2 / R3に対するコンパイル時にエラーが発生しました。

「ファイル」メニューの「環境設定」から
「より詳細な情報を表示する:コンパイル」を有効にすると
より詳しい情報が表示されます。

ボードでESP32 Dev Moduleを指定した場合はエラーにならないけどNefryBTだとエラーに...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.