WiFi Ad-Hoc Network Support

  • I have 3 PicoCore MX8MP Starter Kits which i will be using for experiments with distributed databases.


    So far i have gotten two setups to work: a router-managed network to which the boards then connect, as well as using one of the boards as access point and connecting the others to the AP.


    The most realistic scenario, though, would be an ad-hoc network, which i would like to set up. iw list shows the following supported interfaces, with IBSS (ad-hoc) missing:

    Code
    1. Supported interface modes:
    2. * managed
    3. * AP
    4. * P2P-client
    5. * P2P-GO


    Is there any way to add this functionality? Is this a driver/configuration or hardware issue? Your help is much appreciated.

  • Hello,


    additional I would try commands from mwifiex user manual.

    E.g. with command like

    Code
    1. ...
    2. iw dev mlan0 ibss join <SSID> <freq in MHz> [fixed-freq] [fixed-bssid] [key 0:abcde]
    3. The command will be used to join or create an ibss. Optionally, operating frequency,
    4. bssid and the security related parameters can be specified while joining/creating
    5. and ibss.
    6. ...

    you should be able to create an IBSS (ad hoc) network.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello,

    thank you for you answer.
    I have not used the tutorial you mentioned in #2 from the get-go, but figured out my own way to install uap0:

    Code
    1. > iw dev mlan0 interface add uap0 type __ap

    This does work for the access point, which is not the issue, as i am trying to get ad-hoc mode (IBSS) to work. AP-mode works fine with all the imx8mp boards i have.


    To get IBSS-mode to work, I also tried the command mentioned in #3 before and did so again just now, but it gives the following error:

    Code
    1. > iw dev mlan0 ibss join test 2412
    2. command failed: Operation not supported (-95)

    This does not come as a surprise though, as ibss is not listed in the supported interface-modes i mentioned in #1.

    It looks to me like this is a kernel/driver configuration issue?

  • Hello,


    it seems that the original marvell wlan driver does not support ad-hoc mode and wifidirect as well because of "station-p2p" mode. (driver_mode=0x5) But you can try to use the NXP driver to use wifidirect connection to other device like mobile phone. This can be done by following steps:

    1. Apply the attached patches

    2. Rebuild your yocto image. Our default configuration it is fus-image-std.

    3. Write new sd card image to your boot device eMMC or SD card. This can be done e.g. by steps described in our "how to write sd card image" document.

    4. After boot with new image you should be able to use NXP driver

    4.1 Edit wifi_mod_para.conf file in /lib/fiirmware/nxp directory. Add following configuration:

    Code
    1. SD8997 = {
    2. cfg80211_wext=0xf
    3. wfd_name=p2p
    4. max_vir_bss=1
    5. cal_data_cfg=none
    6. fw_name=nxp/sdsd8997_combo_v4.bin
    7. drv_mode=7
    8. }

    4.2) Copy the firmware sdsd8997_combo_v4.bin from "/lib/firmware/mrvl" to "/lib/firmware/nxp" directory.

    4.3) Load the driver by the command "modprobe moal mod_para=nxp/wifi_mod_para.conf"


    5. Edit wpa_supplicant.conf in /etc/ directory to add p2p configuration:

    Code
    1. ctrl_interface=/var/run/wpa_supplicant
    2. update_config=1
    3. device_name=my_device
    4. driver_param=use_p2p_group_interface=1
    5. p2p_go_intent=1
    6. p2p_go_ht40=1     

    6. Run wpa_supplicant to initilize p2p mode "wpa_supplicant -B -imlan0 -Dnl80211 -c/etc/wpa_supplicant.conf".


    7. Add p2p to mlan0 "wpa_cli -imlan0 p2p_group_add"


    8. Assing an IP address to p2p interface "p2p-mlan0-0"

    "ifconfig p2p-mlan0-0 [IP]"


    9. Set WPS pin "wpa_cli -ip2p-mlan0-0 wps_pin any 0000"


    After this steps it should be possible to connect e.g. a mobile phone over wifidirect with the board.


    Hope this helps.

    0001-Enable-NXP-wlan-mwifiex-driver.patch

    0002-Enable-driver-for-SD8997-config.patch

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello,


    Thank your for the extensive tutorial. I got everything working and was able to rebuild the patched image, as well as flash it and the WiFiDirect (P2P) connection is working as well.


    However, this does not enable the use case i am aiming for, as it does not change the fact, that iw list only lists the available modes mentioned in #1. What i originally thought to be a configuration/driver issue seems to be hardware related after all, as the mode ibss remains unavailable. WifiDirectmerely introduces as softAP, but no real, dynamically routed AdHoc Network. From my current understanding, using the PicoCore MX8MP Boards in an adhoc network is not possible without an additional, external network interface, as the on-board chip does not support ibss mode.


    If there is anything i am missing or misunderstanding i am very happy to do further testing.

    Thanks for the help nonetheless.