Ad-Hoc WiFi on OpenEmbedded

What is the best way to set up an Ad-Hoc network for peer to peer WiFi comms using the OpenEmbedded BSP?

We currently are running the OpenEmbedded 2.8.1 BSP on the Apalis TK1 and using connman to manage our WiFi connection to an Access Point but I have been unsuccessful in configuring as ad-hoc. Our wireless device is the Laird ST60-2230C connected via SDIO.

hi Justin
are you using the mainline or downstream kernel?

did you try following this guide?

Thank you for your response. I apologize for my delay in getting back to you.

We are using the downgrade kernel.

I had not come across that specific guide but I had tried the described steps. I see the following failure:
root@apalis-tk1:~# iwconfig wlan0 mode ad-hoc essid gumstix-network
Error for wireless request “Set Mode” (8B06) :
SET failed on device wlan0 ; Operation not supported

iwconfig (wext interface) is deprecated and not supported on our BSP. We use nl80211 for all BSP.
please look here Ad-hoc networking - ArchWiki for ad-hoc configuration.

Depending on the wireless adapter ad-hoc may not be supported for modes other then 802.11b.

Are you sure you need to use ad-hoc?

It’s probably better to run card in access point mode or use wifi direct.

I had tried the Manual method in the link you provided and I got the following error:

root@apalis-tk1:~# iw wlan0 set type ibss

command failed: Operation not supported (-95)

Perhaps this means not supported by my wireless adapter and/or the provided drivers to support it? I have not tried the wpa_supplicant method in that link yet.

We do need to use ad-hoc as we’d like to explore implementing a mesh network.

Thanks for your responses. If you have any further insights, please share. I’ll report back if I’m able to figure anything out.

For marvell driver you can try doing:

echo “options mwifiex driver_mode=0x7” > /etc/modprobe.d/mwifiex.conf

this will enable station, ap and p2p interfaces. ibss operation should be possible for p2p interface.
I fail to understand why operating in ad-hoc will be better then modern p2p (wifi direct) or standard ap mode for mesh networking.
Ad-hoc mode was created as a workaround for early wifi cards unable to operate in full AP mode.

The reason that I believe I need ad-hoc rather than wifi direct or standard ap mode, is because our CONOP includes forming a multi-hop mesh network. Please point out if you think I have a misunderstanding. I will explain my understanding below.

Considering four nodes, A,B,C,D.

  • A is in range of B and C

  • B is in range of A only

  • C is in range of A and D

  • D is in range of C only

With Wi-Fi Direct, my understanding is that I would have a group leader that essentially acts as an access point for a one to many connection. With my described topology, I could choose A as the group leader/access point in which case I couldn’t talk to D:

A — B

|

C

X

D

Or I could choose C in which case I couldn’t talk to B:

A X B

|

C

|

D

But ad-hoc mode allows for multi-hop forwarding as there is no hierarchy between nodes so I can achieve the topology I want:

A – B

|

C

|

D

I’m really sorry but we do not support any of this obsolete ad-hoc mode stuff.

Just to clarify, does that mean that you don’t support multi-hop mesh networking (using something like B.A.T.M.A.N.) and that is what you are referencing as obsolete?

Can you flash our 2.8b2 image and run this commands:

iw dev
iw dev mlan0 del
iw phy phy0 interface add wlan0 type ibss
iw dev

what’s the output ? what’s the output of dmesg | tail -n100 ?

Thanks. I won’t be able to get to this right away but I will load 2.8b2 and get back to you within the next week.

I am not able to flash from 2.8b1 to 2.8b2 using the “./update.sh” to the SD card method. I have no problems going back to 2.8b1. The error I’m seeing is:

USB device 0: unknown device

e1000: no NVM

e1000: e1000#0: ERROR: Valid Link not detected: -8

missing environment variable: pxeuuid

missing environment variable: bootfile

Retrieving file: pxelinux.cfg/01-00-14-2d-2c-d3-c0

e1000: e1000#0: ERROR: Valid Link not detected: -8

missing environment variable: bootfile

Retrieving file: pxelinux.cfg/C0A80A02

Do I need to follow any different procedures for going from 2.8b1 to 2.8b2?

did you update the complete bsp or only the kernel? Did you try resetting/updating the uboot environment variables?

The full BSP. And thanks, resetting the uboot environment variables did fix it.

root@apalis-tk1:~/wifi_pkg/laird_3_5_5_43# iw dev

phy#0

    Interface wlan0

            ifindex 9

            wdev 0x1

            addr c0:ee:40:40:18:fa

            type managed

            txpower 0.00 dBm

root@apalis-tk1:~/wifi_pkg/laird_3_5_5_43# iw dev mlan0 del

command failed: No such device (-19)

root@apalis-tk1:~/wifi_pkg/laird_3_5_5_43# iw dev wlan0 del

root@apalis-tk1:~/wifi_pkg/laird_3_5_5_43# iw phy phy0 interface add wlan0 type ibss

command failed: Operation not supported (-95)

root@apalis-tk1:~/wifi_pkg/laird_3_5_5_43# iw dev

root@apalis-tk1:~/wifi_pkg/laird_3_5_5_43#

root@apalis-tk1:~/wifi_pkg/laird_3_5_5_43# dmesg | tail -n100

[ 260.056771] EXT4-fs (mmcblk0p2): resizing filesystem from 3833600 to 3834880 blocks

[ 260.072673] EXT4-fs (mmcblk0p2): resized filesystem to 3834880

[ 512.982186] igb 0000:01:00.0 enp1s0: igb: enp1s0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX

[ 513.005596] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

[ 765.494020] mmc2: card b368 removed

[ 771.669214] sdhci-tegra sdhci-tegra.2: Found T2T coeffs data

[ 771.685784] sdhci-tegra sdhci-tegra.2: 200MHz tap hole coeffs found

[ 772.331640] Auto tuning windows***

[ 772.337621] WIN_ATTR legend: 0-BOUN_ST, 1-BOUN_END, 2-HOLE

[ 772.344066] win[0]: 0(0) - 41(1)

[ 772.347917] win[1]: 60(0) - 129(1)

[ 772.351849] win[2]: 148(0) - 217(1)

[ 772.355941] win[3]: 236(0) - 255(1)

[ 772.359943] ***************************************

[ 772.365667] ***tuning windows after inserting holes

[ 772.371658] WIN_ATTR legend: 0-BOUN_ST, 1-BOUN_END, 2-HOLE

[ 772.377315] win[0]:-28(0) - 8(2)

[ 772.380695] win[1]:10(2) - 41(1)

[ 772.384165] win[2]:60(0) - 96(2)

[ 772.387675] win[3]:98(2) - 129(1)

[ 772.391172] win[4]:148(0) - 184(2)

[ 772.394732] win[5]:186(2) - 217(1)

[ 772.398281] win[6]:236(0) - 255(1)

[ 772.401899] ***********************************************

[ 772.407736] *Tuning values

[ 772.412172] estimated values

[ 772.415556] T2T_Vmax 58, T2T_Vmin 81, 1’st_hole_Vmax 8, UI_Vmax 86

[ 772.421984] Calculated values

[ 772.425487] T2T_Vmax 56, 1’st_hole_Vmax 9, UI_Vmax 88

[ 772.430732] T2T_Vmin 56, 1’st_hole_Vmin 9, UI_Vmin 89

[ 772.436028] ***********************************

[ 772.441551] *final tuning windows

[ 772.446994] win[0]: -11 - 1

[ 772.449923] win[1]: 18 - 24

[ 772.453023] win[2]: 77 - 84

[ 772.455956] win[3]: 112 - 112

[ 772.459088] win[4]: 165 - 166

[ 772.462177] win[5]: 206 - 200

[ 772.465259] win[6]: 253 - 238

[ 772.468341] ********************************

[ 772.472762] best tap win - (77-84), best tap value 80 prev_best_tap 0

[ 772.479396] sdhci-tegra sdhci-tegra.2: Found T2T coeffs data

[ 772.485673] sdhci-tegra sdhci-tegra.2: 200MHz tap hole coeffs found

[ 773.131408] Auto tuning windows***

[ 773.137192] WIN_ATTR legend: 0-BOUN_ST, 1-BOUN_END, 2-HOLE

[ 773.142797] win[0]: 0(0) - 40(1)

[ 773.147538] win[1]: 61(0) - 128(1)

[ 773.151583] win[2]: 148(0) - 217(1)

[ 773.155196] win[3]: 236(0) - 255(1)

[ 773.158773] ***************************************

[ 773.163742] ***tuning windows after inserting holes

[ 773.169510] WIN_ATTR legend: 0-BOUN_ST, 1-BOUN_END, 2-HOLE

[ 773.175015] win[0]:-27(0) - 8(2)

[ 773.178259] win[1]:10(2) - 40(1)

[ 773.181492] win[2]:61(0) - 96(2)

[ 773.184733] win[3]:98(2) - 128(1)

[ 773.188064] win[4]:148(0) - 184(2)

[ 773.191498] win[5]:186(2) - 217(1)

[ 773.195006] win[6]:236(0) - 255(1)

[ 773.198498] ***********************************************

[ 773.204158] *Tuning values

[ 773.208527] estimated values

[ 773.211846] T2T_Vmax 58, T2T_Vmin 81, 1’st_hole_Vmax 8, UI_Vmax 86

[ 773.218093] Calculated values

[ 773.221422] T2T_Vmax 56, 1’st_hole_Vmax 9, UI_Vmax 88

[ 773.226472] T2T_Vmin 56, 1’st_hole_Vmin 9, UI_Vmin 89

[ 773.231520] ***********************************

[ 773.236052] *final tuning windows

[ 773.241141] win[0]: -10 - 1

[ 773.243967] win[1]: 18 - 23

[ 773.246770] win[2]: 78 - 84

[ 773.249568] win[3]: 112 - 111

[ 773.252535] win[4]: 165 - 166

[ 773.255503] win[5]: 206 - 200

[ 773.258469] win[6]: 253 - 238

[ 773.261445] ********************************

[ 773.265719] best tap win - (78-84), best tap value 81 prev_best_tap 80

[ 773.272248] sdhci-tegra sdhci-tegra.2: sdhci_tegra_verify_best_tap: tuning freq 200000000hz, best tap 81

[ 773.285262] mmc2: new ultra high speed SDR104 SDIO card at address 0001

[ 792.050538] Loading modules backported from Linux version LRD-REL-3.5.5.43-0-g90c1682

[ 792.063706] Backport generated by backports.git LRD-REL-3.5.5.43-0-g8771847

[ 812.653591] <>

[ 812.667148] SDIO Vendor ID:02df and SDIO Device ID: 9141

[ 812.675863] ieee80211 phy0: lrdmwl_sdio: SDIO FUNC1 IO port: 0x10000

[ 812.683199] ieee80211 phy0: mwl_sdio_init_irq, register IRQ

[ 812.697411] ieee80211 phy0: lrdmwl: found firmware image

[ 812.710389] ieee80211 phy0: downloading FW image (345928 bytes)

[ 813.349766] ieee80211 phy0: FW download over, size 345928 bytes

[ 813.356230] ieee80211 phy0: Checking fw status 100

[ 814.271708] ieee80211 phy0: Waiting on fw status 10 0x0

[ 814.691614] ieee80211 phy0: firmware is ready 14

[ 814.707780] ieee80211 phy0: =>mwl_sdio_enable_int(): enable host interrupt ok

[ 815.730408] ieee80211 phy0: firmware version: 0x8050214

[ 815.760191] ieee80211 phy0: Setting strict regulatory

[ 815.760403] ieee80211 phy0: firmware region code: ff

[ 815.768367] ieee80211 phy0: OTP data len = 0

[ 815.773263] ieee80211 phy0: Command Rejected by FW

[ 815.778530] ieee80211 phy0: mwl_set_caps: Antcfg = 00000003(2) 00000003(2)

[ 815.821165] ieee80211 phy0: 2G enabled, 5G enabled

[ 815.847798] ieee80211 phy0: 2 TX antennas, 2 RX antennas

Can you try with Mainline image? It’s easiest to install it using Toradex Easy Installer.

Don’t know about the TK1, but I can confirm that batman-adv is working well for the imx7 boards that we are using.

Make sure to disable connman though, as it likes to interfere with manual setups.

We used a similar ‘iw dev’ init sequence but had to introduce the one or other sleep as our wifi modules took some time to switch mode.

thanks for this information.

Are there any docs for using Wifi Direct? I can’t find any. Specifically using the LM-816 dongle with Apalis/Ixora (Linux apalis-imx6 4.9.87-2.8.4).

Thanks!

Hi @mk1rallyrabbit
Wifi direct is the same as setting up peer-to-peer connection. Could you ask a new question with all the details about your issue? Thanks.