Wi-Fi: Shell Firmware example with nrf7002

Hi There

I have implemented the nrf firmware example "Wi-Fi Shell" on the nrf7002 development kit.
But I noticed a strange behaviour, after a while I cannot ping any server and it disconnects and reconnects from the access point.

It always gives the error reason=4 for the disconnection:
CTRL-EVENT-DISCONNECTED bssid=a4:6c:f1:fd:82:82 reason=4

Now as I understand it, reason 4 means "disconnected due to inactivity".

Is this conclusion correct is there any documentation about the error and how can I fix this problem so that it does not happen again?

Thanks for your Answer

Parents Reply
  • you could try the following:

    The very first thing to check is if your computer supports monitor mode.

    Windows:

    This is done by going to cmd prompt and entering "netsh wlan show wirelesscapabilities"

    If this prints "Network monitor mode                        : Not supported" then it will not work.

    AX201 is confirmed not working in windows, but will work in linux.

      1. Install wireshark: https://www.wireshark.org/
      2. Install npcap: https://npcap.com/
      3. Follow the guide from npcap to enable monitor mode (again; requires support in your chipset!): https://npcap.com/guide/npcap-devguide.html#npcap-feature-dot11

    This is a bit hit or miss depending if your computer 

    linux:

    In Ubuntu, NetworkManager claims all network interfaces by default. This is problematic, as we want to change the wifi mode from "managed" to "monitor".

    As a workaround, you can manually set the $DEVICE as unmanaged for your current session:

    sudo nmcli device set $DEVICE managed no

    More detailed guide for always marking a device as unmanaged can be found here:

    https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/configuring-networkmanager-to-ignore-certain-devices_configuring-and-managing-networking

    $DEVICE here can be for instance "wlp2s0".

    You can see this by issuing "iw dev" or "iwconfig".

    1. Open a terminal and install wireshark: 

      sudo apt get install wireshark-qt -y

    2. make sure your user has proper permissions to sniff using wireshark by adding your user to the wireshark group (reboot required afterwards): 

      sudo usermod -a -G wireshark $USER

    3. Take your wireless device down: 

      sudo ip link set dev $DEVICE down

    4. set your chipset into monitor mode: 

      sudo iw dev $DEVICE set type monitor

    5. Start up the wifi chipset again: 

      sudo ip link set dev $DEVICE up

    6. Start Wireshark (you might need to start with sudo) and select your wlan device.

    Here is a properly configured device, wlp2s0, set to monitor:

    In Wireshark, to select the channel and bandwidth, you need to check "View → Wireless toolbar":

    in short, I will not say it is a quick way and if it will work depends on your HW and operating system. So i would suggest to try the wifi shell with optimize for debug to see if there is some more information to be had

    Regards

    Runar

Children
Related