Finding IP address of Vera (from a program)

I’m sorry to have to ask this - I’m almost sure it’s been asked before - but, in this case, search is not my friend.

I need to use the current IP address of the Vera I’m running code on. I’ve tried parsing the results of an [tt]ifconfig eth0:0[/tt] command, and that works, but is horrible. I’ve though of sending an HTTP GET to 127.0.0.1 and looking somewhere in the returned headers (but haven’t tried that.)

There has to be an easier way?

Thanks in advance for any suggestions.

http://forum.micasaverde.com/index.php/topic,8505.msg93464.html#msg93464

They’re all hacks, due to multi-homing, but it should get you close-enough…

Ah! Thanks very much. Neater than what I have.

I knew it was there somewhere, but somehow the Sonos thread didn’t come to mind (or search.)

Much later…

… I recently ran across this technique:

[url=http://forums.coronalabs.com/topic/21105-found-undocumented-way-to-get-your-devices-ip-address-from-lua-socket/]http://forums.coronalabs.com/topic/21105-found-undocumented-way-to-get-your-devices-ip-address-from-lua-socket/[/url]

which seems to work well and doesn’t require an external script (I’ve tried it out on 3 VeraLites, one Edge, and one BeagleBone Black.)