-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google now demands an APIKey #17
Comments
My Google Home Mini can speak by the URL generated by the latest version of this module with my ESP32 board, so I don't think that an API key always is required. |
Hi Hirofumi,
Thanks for the quick response. I will quickly send a sample of the url
I used successfully and the response from Google now. I need some time
to set that up.
See you soon.
Kind regards,
Arie.
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virusvrij.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Op vr 23 jul. 2021 om 08:35 schreef Hirofumi Horikawa <
***@***.***>:
… My Google Home Mini can speak by the URL generated by the latest version
of this module with my ESP32 board, so I don't think that an API key always
is required.
And I have no information about an API that needs the key.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHCH3JB4T6M3NCE3CMVI33TTZEERJANCNFSM5A2MFVXQ>
.
|
Hi Hirofumi,
As promised, I tested it again. First via the browser (Chrome) and
that goes well with the
command:https://translate.google.com/translate_tts?ie=UTF-8&q=Hello%2C+World%21&tl=en&client=tw-ob&ttsspeed=1
Then in Visual Code with the same string and then I get Error code: -5.
Could it have something to do with https?
Another test via Visual Code
(https://randomnerdtutorials.com/esp32-http-get-open-weather-map-thingspeak-arduino/)
neatly returns the weather data and the correct return code 200.
But that demo uses http, not https.
See below the code in c++ and the result of three attempts.
If you need more information, I'd love to hear it.
I hope you can help me.
Maybe I'm doing something really stupid.
Thank you very much and best regards,
Arie
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
my code in Visual Code
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
void loop() {
// Send an HTTP GET request
if (millis() >= nextTime) {
// Check WiFi connection status
if(WiFi.status()== WL_CONNECTED){
String serverPath = "";
TTS tts;
Serial.println(tts.getSpeechUrl("こんにちは、世界!", "ja"));
Serial.println(tts.getSpeechUrl("Hello, World!"));
Serial.println("serverPath = "+tts.getSpeechUrl("Hello, World!"));
serverPath = tts.getSpeechUrl("Hello, World!");
jsonBuffer = httpGETRequest(serverPath.c_str());
Serial.println(jsonBuffer);
}
else {
Serial.println("WiFi Disconnected");
}
nextTime = millis()+(6*timerDelay);
}
}
String httpGETRequest(const char* serverName) {
WiFiClient client;
HTTPClient http;
// Your Domain name with URL path or IP address with path
http.begin(client, serverName);
// Send HTTP POST request
int httpResponseCode = http.GET();
String payload = "{}";
if (httpResponseCode>0) {
Serial.print("HTTP Response code: ");
Serial.println(httpResponseCode);
payload = http.getString();
}
else {
Serial.print("Error code: ");
Serial.println(httpResponseCode);
}
// Free resources
http.end();
return payload;
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Result in Visual Code
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Connected to WiFi network with IP Address: 192.168.192.20
https://translate.google.com/translate_tts?ie=UTF-8&q=%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E3%80%81%E4%B8%96%E7%95%8C%EF%BC%81&tl=ja&client=tw-ob&ttsspeed=1
https://translate.google.com/translate_tts?ie=UTF-8&q=Hello%2C+World%21&tl=en&client=tw-ob&ttsspeed=1
serverPath =
https://translate.google.com/translate_tts?ie=UTF-8&q=Hello%2C+World%21&tl=en&client=tw-ob&ttsspeed=1
Error code: -5
{}
https://translate.google.com/translate_tts?ie=UTF-8&q=%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E3%80%81%E4%B8%96%E7%95%8C%EF%BC%81&tl=ja&client=tw-ob&ttsspeed=1
https://translate.google.com/translate_tts?ie=UTF-8&q=Hello%2C+World%21&tl=en&client=tw-ob&ttsspeed=1
serverPath =
https://translate.google.com/translate_tts?ie=UTF-8&q=Hello%2C+World%21&tl=en&client=tw-ob&ttsspeed=1
Error code: -5
{}
https://translate.google.com/translate_tts?ie=UTF-8&q=%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E3%80%81%E4%B8%96%E7%95%8C%EF%BC%81&tl=ja&client=tw-ob&ttsspeed=1
https://translate.google.com/translate_tts?ie=UTF-8&q=Hello%2C+World%21&tl=en&client=tw-ob&ttsspeed=1
serverPath =
https://translate.google.com/translate_tts?ie=UTF-8&q=Hello%2C+World%21&tl=en&client=tw-ob&ttsspeed=1
Error code: -5
{}
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virusvrij.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Op vr 23 jul. 2021 om 08:35 schreef Hirofumi Horikawa <
***@***.***>:
… My Google Home Mini can speak by the URL generated by the latest version
of this module with my ESP32 board, so I don't think that an API key always
is required.
And I have no information about an API that needs the key.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHCH3JB4T6M3NCE3CMVI33TTZEERJANCNFSM5A2MFVXQ>
.
|
If you use HTTPClient of Try using HTTPS connection. The example is the following link (possibly, it might be needed to change the rootCA to an appropriate one). And the response of |
Thanks Hirofumi,
I have work to do again and opportunities for success.
Thank you and I'll let you know the result.
Greetings,
Arie.
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virusvrij.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Op za 24 jul. 2021 om 23:48 schreef Hirofumi Horikawa <
***@***.***>:
… If you use HTTPClient of arduino-esp32 , -5 means
HTTPC_ERROR_CONNECTION_LOST according to the following line. It might be
caused by HTTP connection to HTTP*S* URL (https://...)
https://github.com/espressif/arduino-esp32/blob/6e47e18a1b6f18d5f0b9b21eba2a202ee30601ef/libraries/HTTPClient/src/HTTPClient.h#L44
Try using HTTPS connection. The example is the following link (possibly,
it might be needed to change the rootCA to an appropriate one).
https://github.com/espressif/arduino-esp32/blob/master/libraries/HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
And the response of translate.google.com is not string, it is mp3 binary
data.
I'm not sure what you can get as a result of getString.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHCH3JD4RYH35O7GIH5IVOTTZMYJBANCNFSM5A2MFVXQ>
.
|
Dear Hirofumi,
As promised, the further story that have led to success.
I struggled for a few days but then I found the solution
here <https://github.com/schreibfaul1/ESP32-vs1053_ext/blob/master/README.md
.
Your name was listed here as <text using Google Translate Service (thanks
to horihiro, included esp8266-google-tts library)>
I was already using this library but saw that it had been updated a few
days ago.
I then discovered that the <connecttospeech> function was heavily modified.
I
I then placed that code in my own version of the library and it works!
So the Issue may be closed.
But I want to thank you very much for your (quick) help.
Kind regards,
Arie van den Berg.
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virusvrij.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Op zo 25 jul. 2021 om 16:33 schreef Arie van den Berg ***@***.***>:
… Thanks Hirofumi,
I have work to do again and opportunities for success.
Thank you and I'll let you know the result.
Greetings,
Arie.
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virusvrij.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#m_7785096853815066568_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Op za 24 jul. 2021 om 23:48 schreef Hirofumi Horikawa <
***@***.***>:
> If you use HTTPClient of arduino-esp32 , -5 means
> HTTPC_ERROR_CONNECTION_LOST according to the following line. It might be
> caused by HTTP connection to HTTP*S* URL (https://...)
>
>
> https://github.com/espressif/arduino-esp32/blob/6e47e18a1b6f18d5f0b9b21eba2a202ee30601ef/libraries/HTTPClient/src/HTTPClient.h#L44
>
> Try using HTTPS connection. The example is the following link (possibly,
> it might be needed to change the rootCA to an appropriate one).
>
> https://github.com/espressif/arduino-esp32/blob/master/libraries/HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
>
> And the response of translate.google.com is not string, it is mp3 binary
> data.
> I'm not sure what you can get as a result of getString.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#17 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AHCH3JD4RYH35O7GIH5IVOTTZMYJBANCNFSM5A2MFVXQ>
> .
>
|
Thanks for sharing this code.
I have been able to use this for a long time, with success.
But Google now demands an APIKey and I don't know how to insert it so that it will work again.
I am curious about the solution.
Thank you in advance.
Arie
The text was updated successfully, but these errors were encountered: