Skip to content

wifi.radio.ap_info returns None — no RSSI for the current association #5

Description

@mikeysklar

common_hal_wifi_radio_get_ap_info() in ports/zephyr-cp/common-hal/wifi/Radio.c is a stub that returns mp_const_none; the espressif implementation below it is commented out.

Consequence: there is no way to read the RSSI, BSSID or channel of the AP you are actually associated to. The workaround is a full scan matched against the connected SSID:

import os, wifi
S = os.getenv("CIRCUITPY_WIFI_SSID")
r = [n.rssi for n in wifi.radio.start_scanning_networks() if n.ssid == S]
wifi.radio.stop_scanning_networks()
print(max(r) if r else None, "dBm")

That works (verified, -34 dBm, and it tracks geometry correctly) but costs a scan and briefly uses the radio while associated.

Owner: unassigned

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions