Go Down

Topic: Arduino 101 + Wifi 101 Shield - Hang on scan networks (SOLVED) (Read 1 time) previous topic - next topic

awp2513

Mar 29, 2016, 05:18 pm Last Edit: Apr 08, 2016, 03:43 pm by awp2513 Reason: Title and post includes more information I've discovered while debugging.
I have an Arduino 101 and purchased a 2 Wifi 101 shields, but have been unable to successfully run the example sketches on either.

When attempting to run the Wifi101 ScanNetworks example sketch, it hangs at the following location:

Code: [Select]

// scan for nearby networks:
Serial.println("** Scan Networks **"); <-- Last line I see. This doesn't repeat.
int numSsid = WiFi.scanNetworks();
Serial.println("Does not get printed");


I am also unable to run the Wifi101 ConnectWithWPA sketch (I did use the correct SSID and password):

Code: [Select]

Serial.print("Attempting to connect to WPA SSID: ");
Serial.println(ssid); <-- Last line I see
// Connect to WPA/WPA2 network:
status = WiFi.begin(ssid, pass);
Serial.println("Does not get printed");


EDIT: I've done some digging, and discovered that WiFiClass:scanNetworks() (among other functions) hangs. For startNetworks(), it locks up the Arduino in m2m_hif.c's hif_send() function:

Code: [Select]

reg = dma_addr << 2;
reg |= (1 << 1);
ret = nm_write_reg(WIFI_HOST_RCV_CTRL_3, reg); <-- Hangs if this line executes.
if(M2M_SUCCESS != ret) goto ERR1;



I am able to run the CheckWifi101FirmwareVersion sketch. This reports I am at the required version (19.4.4).

I was unable to use the latest library, 0.9.0, as it doesn't compile, so I used/tried previous versions (0.8.0, 0.7.0) with no success.

In case it matters, I have the latest (1.0.5) Curie board library and Arduino IDE 1.6.8.

Has anyone encountered this or something similar?

awp2513

OK. So, the issue is solved (at least for me). It ended up being an under-power issue (I was powering the Arduino via USB ports). Choosing a different port allowed me to run the scanNetworks example.

Going with a wall wart is probably the way to go, just to be safe.

The bug I filed (before I knew what was going on) and the gory details of the debug can be found here:
https://github.com/arduino-libraries/WiFi101/issues/50#issuecomment-207274348

Hope this helps someone with the same issue!

Go Up