Vera Alerts LAN socket error

I moved Vera Alerts onto an old Asus TF101 tablet with a fresh flash. I’m using the local LAN connectivity, it’s not registered w/ google. It would work for a day or so, then stop working. I guessed that the wifi was going to sleep on the tablet, even though the wifi settings said to never go to sleep. So I installed a Wifi Awake app to make sure it didn’t sleep. This made it work for several days, but it eventually stops working. The tablet does have network connectivity, but Vera Alerts seems to not recover gracefully and doesn’t work right until I reboot the tablet.

Yesterday, I saw several errors in the log in Vera Alerts app that said “Vera Alerts LAN socket error.” Is this coming from my Vera, or is this generated by the app on the android tablet?

Richard, could you look at the socket code and see if there’s anything there that would cause it not to start listening again if the wifi was disconnected or slept?

It’s coming from the Tablet.
You would need to enable logging (Verbose) on the Android App … and send me the log.
If you have the latest version … it resets the connection every hour.

Signal15,

I’ve had the same issue for MONTHS. I think my issue was the reason RTS put his wifi drop/reconnect in his app. I tried so many things, and wasted countless hours trying to fix the issue you are experiencing. It would always work for a few days, then stop working randomly. Trying to generate a verbose log would crash the VeraAlerts app.

My only solution to this issue is take the tablet off LAN mode, and set it up as you would a mobile device. The notifications sometimes are a bit delayed, but they at least work. I’d say 95% of the notifications are instantaneous, 4% come within <10 seconds, and 1% randomly fire off about 5 - 10 minutes later. (That’s not really RTS’s fault, that’s more of a Google issue).

Please let me know if you find a solution to your issue. I’d love to actually get LAN mode working as intended.

I still have not found a resolution. It’s amazingly irritating. I’m looking for an alternative to Vera Alerts, if you have a recommendation, let me know. I paid the license fee for Vera Alerts, I assumed I would at least get some support on any issues.

Searching the Android developers networks … Vera Alerts is not the only app that has this problem …

This appears to be a problem with some (NOT ALL) configurations.
Note: There is Hardware Vendor specific code in both the Network Stack and the Power Management Stack.

Having a Server Socket (For Networks that are always listening) is fighting with the Power Management of Android which is trying to shut things down to save power. Although I do all the right thing to keep Vera Alert’s running (as many have noted when you turn on LAN mode … battery consumption goes way up) … the network and power management still are fighting each other.

The recommendation is to NOT use Server Sockets but to go to a push model like GCM … Vera Alerts supports both models.
Since these are the only TWO ways to get data into an Android app … I do not think you will find a more reliable solution.
The only other solution is to let the Android APP POLL some other server to see if that server has a message for it. That is very resource expensive.

See:
http://forum.micasaverde.com/index.php/topic,32798.msg239448.html#msg239448

For an example of Problems with Power Management and Network.

Note: the solution to make sure you are NOT using IPv6 might solve your problem.

What if the Vera Alerts app on Vera listened on a sockete, and the Android app initiated the connection and did keepalives? Would that resolve the issue?

I have a dedicated Android device for the alerts hooked into the whole house audio system. I don’t care about power management. Would it be possible to do something in the app to make sure the tablet stayed awake and make it a menu option for those that don’t care about power management?

I would have to setup a server process on Vera to handle this … And as I said I would have to continuously poll on the Android end … eating up Vera resources … without doing that I am likely to suffer the same issues.

The problem is that the standard socket protocol that has been around for 40 YRS does not work reliably on the Android for SOME hardware platforms.
My Samsung S3 is my test environment for LAN mode and has run reliably for over 1 yr (as long as I down’t knock the power cable out).

I have an echo in my house since It as well as my Phone using GCM announce messages maybe about 1/2 second apart. But they have different voices and speech rate so the one that starts first … ends last.

I have a similar situation where I’d like to dedicate (permanently install in the house) a device for Vera Alerts and use LAN (not GCM*). It’s nice to know that the Samsung S3 seems reliable - I’ll look for a used one. I wonder if other devices with the same wireless chipset would also be reliable? Per iFixit, the S3 has a Murata M2322007 WiFi Module and Intel Wireless PMB9811X Gold Baseband processor):

If anyone else has found another rock-solid device for LAN alerts, then please post.

I have a HTC Evo (running v4.1.1) that stops receiving VA after a few hours. My LG G Pad 7 (LGV400, v5.0.2) works fine for 1-2 weeks but then needs to be restarted. I used to be able to just toggle WiFi on/off but, for some unknown reason, that no longer solves the problem. For what it’s worth, I use a Wifi Keep Alive app and ping it every 60 sec. This combo seems to help but I never tested it that thoroughly. I just know that out of the box, the tablet would stop receiving alerts within a day or two. But now it goes longer and I just accept that I need to reboot the tablet every now and then.

Oh, I am not using IPv6.

  • The reason I prefer LAN over GCM is that the GCM alerts would occasionally arrive very late and cause confusion (my primary use case is spoken alerts for doors/gates being opened or left open).

Any link/info on how you setup VERA Alerts to send announcements to ECHO?

I will look into an Echo profile for Vera Alerts.

Also I will experiment with reversing the role of server/client ports for Vera Mobile LAN to see if that does not solve some of the problems folks are seeing. I have no way to test that this fixes things … since I have never seen the problem.

might be able to try something like this, if on usb power as would eat battery

“RedEye Stay Awake”

I used a app like that once in past, basicly just a app that make it appear your device is in constant use

I already do that internally when on LAN mode … needed so it does not miss a message … That’s why the battery consumption is so high when you enable LAN mode. That does not solve the problem. This is an interaction between the network layer and the power saving controller … even though I explicitly tell it not use any power saving features.

I found a crude workaround for “resetting” Vera Alerts instead of manually rebooting the Android device. If I use the app Fast Reboot and then launch Vera Alerts, it starts receiving LAN alerts again. On some occasions, I need to toggle Wifi on/off. The app Phone Schedule can automate all of this (EDIT: After scheduling Fast Reboot, I needed the schedule the subsequent Vera Alerts launch a few minutes after running Fast Reboot; it seems like Phone Schedule needs a couple minutes before it starts running again). This is pretty messy but seems to do the trick.

I suppose auto-rebooting the tablet once a day could also work. But I think I’d need to root the phone (I’m not familiar with Android). And rebooting also causes the paired Bluetooth speaker to make un-pairing/re-pairing sounds.

I was having this problem on my old re-purposed Verizon branded Samsung Galaxy S3. I’ve got it permanently wired into my home audio system and its sole purpose is now just to receive and output TTS alerts into that system.

Anyway, I’d been frustrated to no end, despite having disabled every power saving feature in the phone, after about 24-36 hours it would log a “LAN Socket Error” on the alerts page and just give things up. When I’d pickup the phone, again, after a couple of seconds I’d see it say “Wireless Network Connected” as if it were just connecting back to the Wifi network for the first time.

I did a little digging and found out there’s a service menu that Verizon has locked us out of. Other branded Galaxy S3’s may be better off. You will need to have rooted your phone for this, but at this point on an S3 that’s as simple as downloading an app and clicking a button.

You’ll also need a file browser with editing functionality, I like ES File Explorer, but anything will do.

[ol][li]Add the following line to /system/build.prop
sys.hiddenmenu.enable=1[/li]
[li]Change the contents of /efs/carrier/HiddenMenu from OFF to ON[/li]
[li]Reboot the phone[/li]
[li]Open the dialer and type: *#06#
as a test…this will display the phone’s MEID[/li][/ol]

Now we want to turn off the phone’s built-in Wifi Power Saving Mode…why this isn’t a user accessible function I’ll never know…I guess too many complaints about rapidly draining batteries…

[ol][li]Open up the Galaxy S III phone dialer and dial: *#0011#[/li]
[li]When the new screen opens, tap the menu button[/li]
[li]Select WiFi, The WiFi Power Save Mode button should be set to ON (Figure B), so tap the ON button to set it to OFF[/li][/ol]

Last, and I’m not positive this is even necessary, but the original docs I’d found specified you should so I did…
You are going to tell your phone to disconnect from and then forget all wireless networks, one at a time.
You’ll need any security keys for your saved networks, so make sure you have access to them.
Re-scan and re-add the wireless networks adding requisite security keys.

That’s it! So far so good, I’m 48 hours in and haven’t had a disconnection or a LAN Socket Error yet…

With sincere thanks to the original posts where I’d discovered this information:

Hope this is helpful to some of you out there in a similar predicament!

Best to all,
AJM

amikolajczyk,

Thanks for the post! However, I’ve had mine work in LAN mode for up to 5 or so days… Can you check back in a week and let us know if your method is still going strong?

Still going strong without so much as reboot. No socket errors, no WLAN disconnects, not a hitch since my previous post!
If you can root your device, I would strongly advise giving this a try.

Best of luck,
Adam