Hi,
I can trigger voicemonkey in my web browser like this:
I like to trigger this with an arduino sketch. Can somebody point me into the right direction ?
Thank you!
update: By modifying the example HTTPrequestExample, i managed to solve it.
Hi,
I can trigger voicemonkey in my web browser like this:
I like to trigger this with an arduino sketch. Can somebody point me into the right direction ?
update: By modifying the example HTTPrequestExample, i managed to solve it.
Can you be a bit more specific? I'm stuggling at the same point but couldn't get it working with "HTTPSRequest". Getting a 400 bad request.
Thanks!
I modified the HTTPrequest example like this:
void Alexa(String device-ID){
String token="token=c6293k2j371j83bef55_50be98295jd63j2kqj2465a6ded8fc871";
int HTTP_PORT = 80;
String HTTP_METHOD = "GET"; // or POST
char HOST_NAME[] = "api-v2.voicemonkey.io";
String PATH_NAME = "/trigger?" + token + "&device=" + device-ID;
// connect to web server on port 80:
if(client.connect(HOST_NAME, HTTP_PORT)) {
// if connected:
Serial.println("Connected with voicemonkey server");
// make a HTTP request:
// send HTTP header
client.println(HTTP_METHOD + " " + PATH_NAME + " HTTP/1.1");
client.println("Host: " + String(HOST_NAME));
client.println("Connection: close");
client.println(); // end HTTP header
while(client.connected()) {
if(client.available()){
// read an incoming byte from the server and print it to serial monitor:
char c = client.read();
//Serial.print(c); //debug
}
}
// the server's disconnected, stop the client:
client.stop();
Serial.println("disconnected");
} else {// if not connected:
Serial.println("connection failed");
}
}
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.