[quote=“jduchon, post:659, topic:169644”]Hello,
I only got one Play:3 and I have the error 500 in my log.[/quote]
As Play:3 has no line input, that could have been an explanation. But guessed has the same issue with Play:5.
I will disable the call to Browse “AI:” after the first error.
The “no icon” issue happens with all my (favorites) stations : France Inter, FIP, RMC… It’s with TuneIn service.
I use the latest Firefox browser on MacOS.
Jérôme[/quote]
I will verify again with these radio stations in particular.
I do my tests with Firefox and IE9 on Windows Seven.
No icon with IE9 on W7 for : RMC, FIP and France Inter stations. But it works with France Info !?
Same behaviour with Firefox (and the empty frame is flickering).
The issue doesn’t seem to be linked to the OS neither the browser, since I the same behaviour for Firefox on MacOS (I didn’t noticed at first France Info was OK on my Macbook).
Browse with “AI:” is no more called as soon as it fails a first time. So you should get only one error (per Sonos device) after each reload.
The new code for Say callback is present but commented in trunk. Remains to decide in which case we use the normal way and in which case we download the file. And the code to get the Vera IP address has to be added.
So now, I think it remains only one thing to finish before the release: it is relative to the Say callback.
@guessed; what do you want as trigger to use either the normal or the alternative way to call Google traduction ? A setting through a variable that the user can adjust ?
Do you know how to get the IP of the Vera from lua ?
Regarding vera ip. The vera seems to have two interfaces up and running. eth0 and eth0:0. One of the ip:s is probably the open connection to micasaverde (remote access).
I have not found any easier way to fetch local-external-ip than doing an awk-hack.
Given the i18n reqs, I’d think we just switchover to the new TTS technique and give it to people to field prior to release. That’ll avoid the need to carry both options around.
I looked around and could only find a hokey Lua-based mechanism to determine IP. It might be simpler to use @hek’s soln for now, and do it just once at startup. Alternatively we can have a parameter for the IP address and have Vera emit a (Task) message if its not configured when the Say call comes in.
-- Find the Google TTS lenght of a file in seconds
-- filename: file name (32kbps mp3)
-- returns
-- len: length of file (in seconds)
-- asserts on error
function TTS_length(filename)
local fh = assert(io.open(filename, "rb"))
local len = assert(fh:seek("end"))
fh:close()
return len/4000
end
I think it will not work as we will check the length of the file before it is fully downloaded.
Or we have to change something in wget command to be sure that the os.execute returns only when the download is finished.
[quote=“lolodomo, post:648, topic:169644”][quote=“hek, post:645, topic:169644”]We could use the following to get veras external ip-address (maybe there is some easier way?).
I hope there is an easiest way to get it ;D[/quote]
How to get the output of os.execute in lua ? If I pass your command as parameter to os.execute, it returns 0 but how to get the output string (the IP) ?
[quote=“lolodomo, post:667, topic:169644”][b]New version in trunk:
TuneIn radio station logo fixed
Browse “AI:” (to get list of line-in audio inputs) is called only one time if failed
URI for TuneIn is now TR: (PlayURI callback)[/b][/quote]
Verified that both these changes have fixed the problems that I was seeing. Also tested Say method whilst the radio was playing to validate push/pop of state information and that’s working well also.
I put a few screenshots into the Wiki page to showcase your work. We’ll need to chip in a bunch to bring that page up to speed, but we can do that little-by-little. For now, it looks like the bulk of the UI mods are in place.
[quote=“lolodomo, post:674, topic:169644”]I think it will not work as we will check the length of the file before it is fully downloaded.
Or we have to change something in wget command to be sure that the os.execute returns only when the download is finished.[/quote]
Exactly. If we were going that route, then I’d prefer to use [tt]io.popen(…)[/tt] on the [tt]wget[/tt] call, and leave out the “-q” option so we can see it download, and known when it’s finished before doing either a file-length calc (or a summation of the dot-count from [tt]wget[/tt] for rough 1k blocks)
ie. Default the timeout to 10s, “reset” it later when we know better
PS: note that the wget command ends very fast, meaning that Google provides the result file very fast. So my initial conclusion that os.execute returns before the end of downloading could have been an error.
Yup, looks like [tt]os.execute[/tt] is blocking whilst the command runs. We’ll want to background it if we use that technique, since we really don’t know how long it will block for, and Vera will “kill” anything running longer than 30/60s (UI4/UI5), esp since we cannot guarantee what will be “said” using this command, and how fast/slow the network link will be (eg 3G Dongle-modem, etc)