Copyright ©

Mongoose OS Forum


Wi-Fi connection RSSI, signal strength

Is there a way to get RSSI of current connection? Without scanning for available hotspots


  • SergeySergey Dublin, Ireland

    At the moment mOS API does not have that.
    Look in the SDK API.

  • I wrote a simple wrapper for ESP8266 and ESP32:

    #pragma once
    struct WifiInfo
        int8_t rssi;
        uint8_t channel;
    void getWifiInfo(WifiInfo& info);


    #include <mgos.h>
    #include "wifi.h"
    extern "C"
    #if CS_PLATFORM == CS_P_ESP8266
        int8_t wifi_station_get_rssi(void);
        uint8_t wifi_get_channel(void);
    #elif CS_PLATFORM == CS_P_ESP32
    #include <esp_wifi.h>
    void getWifiInfo(WifiInfo& info)
        info.rssi = 0; = 0;
    #if CS_PLATFORM == CS_P_ESP8266
        info.rssi = wifi_station_get_rssi(); = wifi_get_channel();
    #elif CS_PLATFORM == CS_P_ESP32
        wifi_ap_record_t wifidata;
        if (wifidata.primary != 0) {
            info.rssi = wifidata.rssi;
   = wifidata.primary;

    It works on ESP8266 and compiles on ESP32. I don't have yet an ESP32 to test.

  • nliviunliviu Romania
    edited September 2017

    I use C++, but it might be rewritten for C too.

Sign In or Register to comment.