I’m retiring a computer and moving everything to another.
On my old machine, I have a PHP script that uses the MSAPI to speak text on behalf of my Vera.
On the new machine, I’m trying to reproduce things using Girder’s text-to-speech library. I’ve got everything working in Girder and can kick off text from Perl scripts and PHP, but not from Vera.
This should really only involve changing the URL where I point my speech function (in startup LUA) to the new URL.
old:
durl = “http://192.168.1.100/say/?t=” … t
new:
durl = “http://192.168.1.110/gir/speak.lhtml?t=” … t
Then I kick off the speech with
http = require("socket.http")
local body, code, headers, status = http.request(durl)
But the new isn’t working.
I’ve tried looking at the response using
luup.log(body)
luup.log(code)
but they log null for both working and non-working code, so I obviously don’t understand what’s returned.
I have the script in Girder returning text so that Vera knows it’s not an empty return. I’ve looked at the headers using Firefox and Girder is returning a 200 OK header.
Can anyone point me in the right direction?
Here’s a simplified version that I’m using in my “test LUUP code”:
function say(text)
t = "this%20is%20a%20test"
-- this is the OLD URL
-- durl = "http://192.168.1.100/say/?t=" .. t
-- This is the new
durl = "http://192.168.1.110/gir/speak.lhtml?t=" .. t
http = require("socket.http")
http.TIMEOUT = 10
local body, code, headers, status = http.request(durl)
end
say()