1

I have an app installed on the raspberry pi 3 using AndroidThings [preview 0.4]. IN the app code I make a connection to the wifi. I then do a call to the wifiManager to get the connection info.

WifiInfo info = wifiManager.getConnectionInfo();
String ssid = info.getSSID();
String state = info.getSupplicantState().name();
int ipAddress = info.getIpAddress();
String ip = String.format("%d.%d.%d.%d", (ipAddress & 0xff), (ipAddress >> 8 & 0xff), (ipAddress >> 16 & 0xff), (ipAddress >> 24 & 0xff));
boolean enabled = wifiManager.isWifiEnabled();
String result = "wifi: " + ssid + " ip: " + ip + "  " + state + " enabled:" + enabled;

The result prints out as 'wifi: "milt-att" ip: 0.0.0.0 COMPLETED enabled:true

If I restart the app several times I will eventually get a legitimate ip address. If the SSID is not valid or the passkey to the SSID is incorrect, it tells me that it is DISCONNECTED. Why do I not get a valid ip address once connected?

Milt
  • 41
  • 2
  • I left it sit for about 1.5 hours when I went out. When I returned it finally had a legitimate ip address. – Milt May 18 '17 at 00:10
  • Again after about 1.5 hours the ipAddress is finally instantiated. If I look at the androidThings screen it shows Wifi "milt-att" connected but no ipAddress showing. After the 1.5 hours the ipAddress finally also shows on this screen. I will be getting some additional raspberry pi 3 boards in the next few days and will try to see if it is related to the board and not the OS. – Milt May 18 '17 at 16:06
  • 1
    The only changes I made to the config.txt file as delivered in the preview was to identify the display that was connected. I set hdmi_group=2 and hdmi_mode=28. Just want to point out that it does eventually have a correct ip address. It just seems to take a long time to show even though it is connected to a wifi signal. – Milt May 19 '17 at 17:28
  • You might [connect to serial console](http://stackoverflow.com/questions/43554006/android-things-connect-to-serial-console) to read early boot up logs. If it helps to find out the reason, come back here and share your investigation results by answering own question :) – Onik May 19 '17 at 18:08
  • That requires me to go out and get a usb to TTL cable. Isn't there a way to take the microsd card and read the logs on there or aren't they stored on the microsd card? – Milt May 19 '17 at 22:01

0 Answers0