How to capture device IP address?