Wifi sniffer capability; often asked for, never delivered?
-
Hello!
Covid -19 has given me time to ressurect my embedded experiments!
I've noted that there are a number of esp32 solutions to "promiscuous" wifi sniffing (mostly in "C"), indeed Zerynth provide a "compiled python solution" that can be targeted to the pycom modules. Over the years there have been requests for this facility in Pycom; so my question is, "Does WIFI sniffing exist, will it ever exist? If it does where is the documentation, examples etc. For sure a "work round" solution can be created that uses a slave esp32 running alongside a Pycom module, but this is not very elegant.
I'm keen to have an answer, please.
Many thanks in advance.
-
@drgdhorler We added experimental support for this. Below is some example code to capture MAC addresses.
from network import WLAN import ubinascii def pack_cb(pack): mac = bytearray(6) pk = wlan.wifi_packet() control = pk.data[0] subtype = (0xF0 & control) >> 4 type = 0x0C & control #print("Control:{}, subtype:{}, type:{}".format(control, subtype, type)) if subtype == 4: for i in range (0,6): mac[i] = pk.data[10 + i] print ("Wifi Node with MAC: {}".format(ubinascii.hexlify(mac))) wlan = WLAN(mode=WLAN.STA, antenna=WLAN.EXT_ANT) wlan.callback(trigger=WLAN.EVENT_PKT_MGMT, handler=pack_cb) wlan.promiscuous(True)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login