[GH-ISSUE #299] Is there documentation on Connection Result variables #250

Closed
opened 2026-02-28 01:24:19 +03:00 by kerem · 5 comments
Owner

Originally created by @mfzeidan on GitHub (Jan 21, 2017).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/299

I'm having trouble finding anything where I can read about what the connection results (0-4 I believe) mean. They seem to change from 0, 3 or 4 and i want to set deepsleep options based on these connection results.

Originally created by @mfzeidan on GitHub (Jan 21, 2017). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/299 I'm having trouble finding anything where I can read about what the connection results (0-4 I believe) mean. They seem to change from 0, 3 or 4 and i want to set deepsleep options based on these connection results.
kerem 2026-02-28 01:24:19 +03:00
  • closed this issue
  • added the
    Question
    label
Author
Owner

@RuBiCK commented on GitHub (Feb 17, 2017):

I'm getting connection result 4 and I don't know what does it mean so I cannot make any troubleshooting because I don't know if it's a password/cipher or any other thing

<!-- gh-comment-id:280609706 --> @RuBiCK commented on GitHub (Feb 17, 2017): I'm getting connection result 4 and I don't know what does it mean so I cannot make any troubleshooting because I don't know if it's a password/cipher or any other thing
Author
Owner

@witnessmenow commented on GitHub (Oct 24, 2017):

Why was this closed? Is there documentation on this?

<!-- gh-comment-id:338923401 --> @witnessmenow commented on GitHub (Oct 24, 2017): Why was this closed? Is there documentation on this?
Author
Owner

@mfzeidan commented on GitHub (Oct 24, 2017):

No idea, I never got an answer

On Oct 24, 2017 5:01 AM, "Brian Lough" notifications@github.com wrote:

Why was this closed? Is there documentation on this?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/tzapu/WiFiManager/issues/299#issuecomment-338923401,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGCCzF75T7WJsBbhKZVRfyP7E3v2oIqVks5svadjgaJpZM4LqKXJ
.

<!-- gh-comment-id:338965204 --> @mfzeidan commented on GitHub (Oct 24, 2017): No idea, I never got an answer On Oct 24, 2017 5:01 AM, "Brian Lough" <notifications@github.com> wrote: > Why was this closed? Is there documentation on this? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/tzapu/WiFiManager/issues/299#issuecomment-338923401>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AGCCzF75T7WJsBbhKZVRfyP7E3v2oIqVks5svadjgaJpZM4LqKXJ> > . >
Author
Owner

@tablatronix commented on GitHub (Oct 24, 2017):

// connection results
String getConnResString(uint8_t status){
    switch(status) {
        case STATION_GOT_IP:
            return "WL_CONNECTED";
        case STATION_NO_AP_FOUND:
            return "WL_NO_SSID_AVAIL";
        case STATION_CONNECT_FAIL:
        case STATION_WRONG_PASSWORD:
            return "WL_CONNECT_FAILED";
        case STATION_IDLE:
            return "WL_IDLE_STATUS";
        default:
            return "WL_DISCONNECTED";
    }
}

And the enums for status

// wl_definitions.h
typedef enum {
    WL_NO_SHIELD        = 255,   // for compatibility with WiFi Shield library
    WL_IDLE_STATUS      = 0,
    WL_NO_SSID_AVAIL    = 1,
    WL_SCAN_COMPLETED   = 2,
    WL_CONNECTED        = 3,
    WL_CONNECT_FAILED   = 4,
    WL_CONNECTION_LOST  = 5,
    WL_DISCONNECTED     = 6
} wl_status_t;

// user_interface.h
typedef enum {
    STATION_IDLE = 0,
    STATION_CONNECTING,
    STATION_WRONG_PASSWORD,
    STATION_NO_AP_FOUND,
    STATION_CONNECT_FAIL,
    STATION_GOT_IP
} station_status_t;

<!-- gh-comment-id:338993097 --> @tablatronix commented on GitHub (Oct 24, 2017): ```C++ // connection results String getConnResString(uint8_t status){ switch(status) { case STATION_GOT_IP: return "WL_CONNECTED"; case STATION_NO_AP_FOUND: return "WL_NO_SSID_AVAIL"; case STATION_CONNECT_FAIL: case STATION_WRONG_PASSWORD: return "WL_CONNECT_FAILED"; case STATION_IDLE: return "WL_IDLE_STATUS"; default: return "WL_DISCONNECTED"; } } ``` And the enums for status ```C++ // wl_definitions.h typedef enum { WL_NO_SHIELD = 255, // for compatibility with WiFi Shield library WL_IDLE_STATUS = 0, WL_NO_SSID_AVAIL = 1, WL_SCAN_COMPLETED = 2, WL_CONNECTED = 3, WL_CONNECT_FAILED = 4, WL_CONNECTION_LOST = 5, WL_DISCONNECTED = 6 } wl_status_t; // user_interface.h typedef enum { STATION_IDLE = 0, STATION_CONNECTING, STATION_WRONG_PASSWORD, STATION_NO_AP_FOUND, STATION_CONNECT_FAIL, STATION_GOT_IP } station_status_t; ```
Author
Owner

@tablatronix commented on GitHub (Oct 27, 2017):

Sorry, That is the conn result for the SDK
It should be the wl_status for WiFi.status()

String WiFiManager::getWLStatusString(uint8_t status){
  const char * const WIFI_STA_STATUS[]
  {
      "WL_IDLE_STATUS",
      "WL_NO_SSID_AVAIL",
      "WL_SCAN_COMPLETED",
      "WL_CONNECTED",
      "WL_CONNECT_FAILED",
      "WL_CONNECTION_LOST",
      "WL_DISCONNECTED"
  };

  if(status >=0 && status <=6) return WIFI_STA_STATUS[status];
  return "UNKNOWN";
}
<!-- gh-comment-id:340050060 --> @tablatronix commented on GitHub (Oct 27, 2017): Sorry, That is the conn result for the SDK It should be the wl_status for WiFi.status() ```C++ String WiFiManager::getWLStatusString(uint8_t status){ const char * const WIFI_STA_STATUS[] { "WL_IDLE_STATUS", "WL_NO_SSID_AVAIL", "WL_SCAN_COMPLETED", "WL_CONNECTED", "WL_CONNECT_FAILED", "WL_CONNECTION_LOST", "WL_DISCONNECTED" }; if(status >=0 && status <=6) return WIFI_STA_STATUS[status]; return "UNKNOWN"; } ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#250
No description provided.