question

IainWhite-1972 avatar image
0 Votes"
IainWhite-1972 asked IainWhite-1972 commented

How would I find the IP address of my edge device

I'd like a nice way to know what IP address my Edge Device has been allocated when I connect it to a network. I was planning on writing a simple bit of code in a module which logs it, but I can't seem to find a way to access it because the application runs in a container and I'm only getting docker internal IPs.

Can anyone suggest a nice way to do this in a nodeJS module? (Or any other supported module language)

Or is there any other way I can find it (without having to look for the device on my network)?

azure-iot-edge
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SandervandeVelde42 avatar image
1 Vote"
SandervandeVelde42 answered IainWhite-1972 commented

Hello anonymous user,

Azure IoT Edge modules are not aware of their host or the host IP address.

You have to 'escape' the boundaries of your edge module and make contact with something that 'lives' on the host.

This can be a local service or a script executed once in a while.

I have not tried this but it should be simple to runs some (Linux) script (which checks the IP addresses of all networks attached) from the crontab which writes some message in a volume that is reachable by the module.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I was actually considering something along these lines @SandervandeVelde42. Thanks for confirming there's not a more simple way.

0 Votes 0 ·