Getting IP address of device


In the summary section of the resin console of each device, you can see that it tells you what the IP ADDRESS is of the current device. Is there an easy way to get this number in a service / host os?

My goal is to record this in an environment variable locally on boot so that my application’s know what the IP address is.


Hey @bgold, you can do this using the Supervisor API from within one of your containers:

curl -X GET --header "Content-Type:application/json" \ "$RESIN_SUPERVISOR_ADDRESS/v1/device?apikey=$RESIN_SUPERVISOR_API_KEY"

This will give you the IP amongst other things; take a look here:
Note if you’re running multicontainer you need to enable it:

Hope this helps!


Awesome, thank you sir. This will do.

Would be amazing to see this end up in the RESIN_ Environment Variables at some point. Seem’s useful enough but what do I know haha