I have a little problem again. I’m still a big Rhasspy noob, so I hope for your patience.
I use a remote HTTP server to handle intents, I specified a URL to a client socket (TCP protocol). On the side of this client I can print the JSON, that rhasspy transmits. I use PHP for this. Works perfectly.
The how-to says: "When an intent is recognized, Rhasspy will POST to handle.remote.url with the intent JSON. You should return JSON back, optionally with additional information. "
But I don’t know how to return the JSON. I tried:
$url = "RHASSPY_IP:PORT/api/events/intent"; $curl_header = array ( "cache-control: no-cache", "content-type: application / json" ); $ curl = curl_init (); curl_setopt_array ($ curl, array ( CURLOPT_URL => $ url, CURLOPT_RETURNTRANSFER => true ) ); $ response = curl_exec ($ curl); $ error = curl_error ($ curl); curl_close ($ curl);
But then I get in the Rhasspy Log:
quart.serving: 192.168.178.31:41386 GET /api/events/intent 1.1 500 15 13650 [ERROR: 7642103] __main__: BadRequest (400) Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/quart/app.py", line 1471, in full_dispatch_request result = await self.dispatch_request (request_context) File "/usr/local/lib/python3.6/dist-packages/quart/app.py", line 1513, in dispatch_request raise request_.routing_exception quart.exceptions.BadRequest: BadRequest (400)
The listener then stops working and I have to restart Rhasspy. What do I have to return correctly?
Thanks for help!