Android as a Speech/Alarm Device released! And Updated!

@Big_Webstas Because I’m using some APIs introduced after Kit Kat. In the LANnouncer Android Requirements section of the web site, I state:

LANnouncer requires SDK 21, which means Lollipop, Android 5.0, or above. This isn’t capricious; because I’ve updated all of my devices and because I initially wasn’t even considering publishing this (it was just to solve an annoyance), I used Android methods supported by my devices. Specifically, the AudioAttributes.Builder class, added in SDK 21.

I do sympathize, but Kit Kat was released in October 2013, so it’s a bit long in the tooth. :wink:

@DParker You covered a lot there. Let’s start at the beginning…

  • GCN and WAN mode work without Premium; they’re just throttled, meaning you can’t do two commands quickly
  • And yeah, I haven’t put up how to get at Premium yet. Basically, I’m planning a few dollar donation gets the unthrottled version. I’m also playing with less throttling, because really I’m not in this for the money, but now it’s costing me money.
  • I haven’t run into a device refusing to speak. Nor the hangs. So if you don’t mind, please install a logcat reader such as CatLog and grab some data on what’s going on. Send me that along with what device you’re using. It may be that a permission isn’t matched for your device.

Thanks

1 Like

Thanks for the offer of help, Tony. But all of the Android logcat readers I’ve found (including CatLog) require root access to read the logs, and my phone isn’t rooted. Secondly, after further review I don’t think LANnouncer is really the solution to the problem I’m trying to solve after all (poor analysis on my part). So there’s really no point in pursing this any further.

My apologies for having wasted as much of your time on this as I already have.

Great, let us know when you figure how to get the premium option, I’m definitely into it.

@NWTony I just wanted to let you know that having not found any solutions that were an exact fit for what I’m trying to do (voice announcements via Echo in the native Alexa voice) I decided to give Lannouncer another try. Once I got home and was able to use LAN communication I was able to make things work correctly, and after a little hacking together of your software and Rule Machine (which is new to me) I know have the Echo in my master bedroom saying “Good night” after I instruct it to turn off the bedroom lights for the night.

So, I just wanted to thank you for providing the critical component I needed to get at least this functionality pieced together. If it continues to work well and you get the premium option going (at a reasonable rate, of course) you can count me as a contributor.

Not sure if you want this in here or via e-mail, but I have some problems and thought I’d post here to see if there are any fixes…

I am able to get it to play words, phrases, etc, and this is REALLY DAMN COOL!
So, regardless of the rest of this post, THANK YOU! :slight_smile:

My problems are…

  1. Taking pics doesn’t work.
    Whether I click on the button in the device handler or in the Android app, doing so causes LANnouncer to immediately crash.
    Since LANnouncer can’t actually use the front camera anyway, I don’t really care so much right now. The crashing is irrelevant. I’m just noting that I can’t get it to take a pic.

  2. Erroneous Error Message?
    When I look in the Android app, it often/usually says,
    "Could not open listening socket on port #####"
    The odd part is that it says this even during periods when it is working just fine.
    So, does this line actually mean anything?

  3. Screenshot Sound?
    Before installing and starting to use LANnouncer, the table I’m testing it on would never make a sound upon taking a screenshot. Now it makes a sound every time I take a screenshot.
    As with taking pics, this is not huge problem, but it’s just annoying. Any idea what’s going on here, and/or how to make it stop doing this?

I’ve installed LANnouncer on a new android fire tab 7 with Cyanogen 12.1 (to get rid of the amazon bloatware). I can’t seem to get any sound from the device (in Smartthings) but can get the alarm to sound when I use a browser to visit my local ip: 192.168.1.200:1035/?ALARM=SIREN&@DONE@. Siren sounds fine.

When I look at the smartthings logs, everything seems to be communicating fine:
31304d38-68e6-4951-87fa-377f461ecf32 4:35:16 PM: debug 040B
31304d38-68e6-4951-87fa-377f461ecf32 4:35:16 PM: debug IP address entered is 192.168.1.75 and the converted hex code is C0A8014B
31304d38-68e6-4951-87fa-377f461ecf32 4:35:16 PM: info Sending command &ALARM=SIREN&@DONE@ to 192.168.1.75:1035
31304d38-68e6-4951-87fa-377f461ecf32 4:35:15 PM: info Command request: &ALARM=SIREN&@DONE@
31304d38-68e6-4951-87fa-377f461ecf32 4:35:15 PM: debug Executing 'siren’
31304d38-68e6-4951-87fa-377f461ecf32 4:35:15 PM: debug Executing notification with null
31304d38-68e6-4951-87fa-377f461ecf32 4:35:14 PM: debug GET /&ALARM=CHIME&@DONE@ HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: 192.168.1.75:1035

31304d38-68e6-4951-87fa-377f461ecf32 4:35:14 PM: debug 040B
31304d38-68e6-4951-87fa-377f461ecf32 4:35:14 PM: debug IP address entered is 192.168.1.75 and the converted hex code is C0A8014B
31304d38-68e6-4951-87fa-377f461ecf32 4:35:14 PM: info Sending command &ALARM=CHIME&@DONE@ to 192.168.1.75:1035
31304d38-68e6-4951-87fa-377f461ecf32 4:35:14 PM: info Command request: &ALARM=CHIME&@DONE@
31304d38-68e6-4951-87fa-377f461ecf32 4:35:14 PM: debug Executing 'beep’
31304d38-68e6-4951-87fa-377f461ecf32 4:35:05 PM: debug GET /&ALARM=SIREN&@DONE@ HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: 192.168.1.75:1035

So it seems the two are talking but no audio occurs if I press the siren button from within the Smartthings app. Any idea why? Bigtalker doesn’t work either.

Thanks…this looks like the exact solution I have been looking for (once I get it working!)

@byoung exact same issue for me, using a fire too.
I can use curl to get the device to do everything, but from within smartthings nothing happens
I have obviouslly set the IP in smartthings for the device but for some reason none of the buttons work?

Also I take it this device type / smartapp is just a base for people making new apps? i.e. if i go to my home report I can choose sonos speakers as output but not my android device type, so i suspect I’d need to write code to send queries to the android?

So I rebooted my hub and came back an hour later and now it magically works! No idea why, but I’m thrilled! Worth a shot @icepicknz

I take it back @icepicknz …looks like just the siren and tone work. not the speech.

Hey all, I’ll take a look at all this. My test suite is passing the audio files, speech tests, toasts, remote camera uploads, strobe/flash tests and dropbox syncs. All those tests are passing, but I notice I am not testing the local camera. And it’s not working.

— Edit: It is working, I just forgot where photos go. SDCard 0/Pictures/LANNouncer. And I had over 1400 there; I’ll have to add a new feature to prune those. :wink:

How are you trying to do voices and play files? Again, it’s passing my test suite and is documented on the website; if you can write me what you’re trying, it may be a simple thing to figure out.

I’ve just been trying to use the LANnounce device and pressing the speak or notify button. Everything else works except speech (siren, tone).

B

The screenshot sound is probably just LANNouncer turning up the volume. Android makes a camera noise by default when taking a screen shot, but you may have had that volume down.

Taking a picture shouldn’t crash, obviously. I’m not seeing that. What version of Android?

Hey Brooke, perhaps my device driver in Groovy got broken by the recent SmartThings updates. The commands still pass my tests. You can verify them from curl or, if you prefer, from a web browser on the same network as the Android device and SmartThings hub.

In your browser, plug in your device IP address (the Reported IP Address about five lines down on the LANNouncer screen) instead of the 192.168.1.20 in this URL:

http://192.168.1.20:1035/?ALARM=SIREN&@DONE@

Your device should log that it received “Sound Alarm: SIREN” and should play a siren. The browser should say something like “LANnouncer: OK”.

Does that work?

Yep…that works fine. Siren and tone work…just not the speech stuff. Wondering if it is the custom rom I am running.

Good to hear. Nope, it wouldn’t be the custom ROM. LANNouncer is working fine.
For the speech stuff, you may have configured and then removed a TTS engine. Try installing SVOX Classic or something similar and selecting a voice.
But it also doesn’t seem to be the device driver; it’s working fine for me.
Does LANNouncer show any commands coming in when you try those, or does it crash too quickly? If it’s crashing, do you mind installing LogCat or some similar logger and filtering on “lann” to see what happened? I put a lot of data out there.

It seems to only crash when I try to take a screen shot…which is fine as I don’t need this functionality. It shows the commands going through in my IDE logs. I’ll install LogCat and see what I can find. It just appears to do nothing. Bigtalker is also not working.

@NWTony Here are some [logs] (https://drive.google.com/open?id=0B0bBDH-hxCWbZmhXTnFLUzNQVkk)

Those are some fascinating logs. It looks like the camera and flash calls are simply crashing out of the system, disregarding the try-catch loops.

You said it’s a Kindle Fire - it doesn’t actually have a camera, correct? Something must be wrong in my detection.

Yep it has 2 cameras. Front and back. Any info there help with the speech? I can try triggering it again and see what it captures if not. This is the device: http://www.amazon.com/Fire-HD-Display-Wi-Fi-GB/dp/B00IKPYKWG