Member #157077

Member Since: October 18, 2010

Country: United States

  • Product WRL-09954 | about 3 years ago

    The readme.txt file in the WiFly library says:
    If the network you want to connect to has no passphrase you can use this form:
    if (!WiFly.join(“ssid”)) {
    // Handle the failure

    }

    After a number of hours of banging on this, I seem to have determined that it should say “you MUST use this form”. I was always unable to join an open network when making the WiFLy.join call with 2 args; I have been able to connect when I call it with only 1 arg (the ssid).
    In addition, once I made a 2-arg call even once, it would never join again (even with a 1-arg call) until I had issued a “factory RESET” command.
    I changed the code in the sample WiFly_WebClient program FROM:
    WiFly.begin();
    if (!WiFly.join(ssid, passphrase)) {
    Serial.print(“Association failed.”);
    while (1) {
    // Hang on failure.
    }
    TO:
    int joined;
    WiFly.begin();
    // apparently, it’s necessary to omit the second (passphrase) argument, if joining an open network!
    if (strcmp(passphrase, “”) == 0) {
    joined = WiFly.join(ssid);
    }
    else {
    joined = WiFly.join(ssid, passphrase);
    }
    if (!joined) {
    Serial.print(“Association failed.”);
    while (1) {
    // Hang on failure.
    }
    This has not been extensively tested yet, but appears to solve the problem.

No public wish lists :(