Arduino Yun : WiFI State detection

I have two simple questions for Arduino Yun board board.

  1. I have configured WiFi on my board. Is there any programmatic (API) to know WIFI is connected and my program can use it.

  2. Is there any external way to know the IP address of the board so that I can use Putty. As of now, router logs is the only way I found.

I know these seems to be very silliy questions but I couldn’t figure out by myself.

THanks in advance.

Regards,
Nagesh

Nagesh: 1. I have configured WiFi on my board. Is there any programmatic (API) to know WIFI is connected and my program can use it.

You can use the ping command or the ifconfig/iwconfig command and then parse their output to check if you have an ip or an internet connection.

Nagesh: 2. Is there any external way to know the IP address of the board so that I can use Putty. As of now, router logs is the only way I found.

You can find your Arduino Yun as http://arduino.local. You have to change "arduino" with the name of your board.