create capture file (for wireshark) with esp32

I have a SparkFun ESP32 Thing. This is connected to my wifi with given SSID and password. I want to receive now all packets that goes threw this network and create a capture (.cap) file for wireshark. Is this possible?

You should be able to use wireshark installed on a PC in the same network to analyse traffic to/from the WLAN connected device.
See "monitor" and "promiscuous" modes here: CaptureSetup/WLAN - The Wireshark Wiki

Jep, but thats not what i want. I want to create the .cap on the device itself.

matt777:
I have a SparkFun ESP32 Thing. ... I want to receive now all packets that goes threw this network and create a capture (.cap) file for wireshark. Is this possible?

The ESP32 seems to support Promiscuous Mode, so it should be possible.