Why wifi.scan() return garbage for BSSID?

The docs says:

Return the list of available wifi networks as a tuple of tuples: (SSID, network_security, RSSI, BSSID).

But esp32wifi returns

(Vinicius, 3, -64, ?���)
(Oi WiFi Fon, 0, -75, �k[�) (LUCIMAR LIMA, 3, -76, �k[�)
(VIVOFIBRA-4B60, 3, -89, r#9K^)
(MERCUSYS_980E, 0, -91, �����)

And BSSID is NONE returns false, and if BSSID enters as true.

When BSSID didn’t exists it could return None or a falsy value.

Could you tell which board you are working on, Also could you post the code ?
If you haven’t checked it already, I think it would also be helpful to look at the Wifi scan example.

Hi @JanainaScal, that garbage chars on the serial console are printed because BSSID is a bytes object.
If you want to print the HEX representation of the BSSID, you could try something like this:

print(":".join([hex(e,prefix='') for e in bssid]))
# F0:9F:C2:95:E1:4F

Let me know if this approach fits your needs

Hi @anba, that solved it, thanks!

Hi @karimhamdy1,

I supose the board in this case do not matter, but in using esp32.
I have check the Wifi scan example. , but it don’t use BSSID, only the 3 firsts parameters: RSSI,SSID and Authantication level.

Anyway, that is solved.
Thanks for the reply ^^