An agent clearly already knows the IP address of it’s related Imp.
However this information is not exposed via the API.
It would be nice to have e.g. device.getipaddress().
My particular use-case is as follows…
In order to make it easier to distinguish each new Imp as it comes online I’d like an initial automatic approximation of its location.
I could use a geolocation service but for this I need to know the Imp’s IP address or to be more accurate the address the agent has for the Imp (most Imps presumably connect to world via an access point using NAT and so themselves just see a private network address).
I know there are lots of issues with geolocation services but they’re better than nothing. At the moment I’m using Xively and there one can associate a location with a feed, I’d very much like to automatically fill in an initial location for each Imp (with obviously the possibility to improve or correct this information manually later).