I want to build a multi-radio ad-hoc network using the RPi 3. So far I am able to create a 2 node network using the on-board WiFi interface (broadcom, wlan0).

I tried to add a second interface (rtl8812au, wlan1). I compiled the driver from source (tried 2 repos: https://github.com/gnab/rtl8812au and https://github.com/astsam/rtl8812au). Both drivers compile ok. When I boot, it seems to work (I can see both wlan interfaces).

My problem is that it looks like I cannot use both interfaces at the same time (I ommitted lo and eth0):

pi@rpi1:~ $ ifconfig     
wlan0     Link encap:Ethernet  HWaddr 74:da:38:84:2c:cc  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::76da:38ff:fe84:2ccc/64 Scope:Link
          RX packets:1 errors:0 dropped:2 overruns:0 frame:0
          TX packets:2 errors:0 dropped:39 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:24 (24.0 B)  TX bytes:810 (810.0 B)

wlan1     Link encap:Ethernet  HWaddr b8:27:eb:8c:82:f4  
          inet addr:  Bcast:  Mask:
          RX packets:16 errors:0 dropped:16 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1825 (1.7 KiB)  TX bytes:0 (0.0 B)

pi@rpi1:~ $ iwconfig 
wlan0     IEEE 802.11abgn  ESSID:"channelEleven"  
          Mode:Ad-Hoc  Frequency:2.462 GHz  Cell: AA:69:A6:90:CB:7B   
          Tx-Power=12 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off

wlan1     IEEE 802.11bgn  ESSID:"channelFour"  
          Mode:Ad-Hoc  Frequency:2.427 GHz  Cell: Not-Associated   
          Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on

As you may see, wlan0 has tx-power = 12dbm, while wlan1 is 31dbm. As far as I could understand, at boot time, the Pi randomly chooses one of the interfaces to be the main one (whichever has 30+ dbm), some times it's wlan0 sometimes wlan1.

If I turn a secondary Pi (rpi2) with the same settings (different ip of course), I am able to ping both interfaces, but it turns out only one iface is used (i.e. the RX/TX bytes never increase on the 12dB one), thus only one interface is being controlled/used/whatever the correct term is.

I'm not the most driver/savvy person, am I missing some config? This is my /etc/network:

auto lo
iface lo inet loopback

iface eth0 inet manual

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
wireless-essid channelEleven
wireless-channel 11
wireless-mode ad-hoc

auto wlan1
allow-hotplug wlan1
iface wlan1 inet static
wireless-essid channelFour
wireless-channel 4
wireless-mode ad-hoc

Thanks in advance!


This is the topology I'm trying to make:

| node1                |
| wlan0     | wlan1    |
| | |
     /|\           /|\
      |             |
      |             |
(channel 11)   (channel 4)
(freq 2.462)   (freq 2.427)
      |             |
      |             |
     \|/           \|/
| wlan0     | wlan1    |
| | |
| node2                |

Another piece of information: I thought the power supply might be the issue, but I don't think it is, I had a 5V 1A supply before, now I have a 5V 2.5A, but the problem persists.

  • Building a mesh network? – user2497 Jul 4 '17 at 0:55
  • Though not an answer, look at en.wikipedia.org/wiki/Freifunk?wprov=sfsi1 . Freifunk does mesh, though I'm not aware of its spread outside germany. Get a few images, have a look at the conf files. – user2497 Jul 4 '17 at 0:58
  • Yes, I am building a mesh testbed. Although Freifunk is a similar project, it is nos suited for me. They use OpenWRT, I need a full stack OS, I'll be running applications in each node. Also, I couldn't identify any multi-radio aspect of it, which in my case is essential! Thanks though. – regisin Jul 5 '17 at 16:27

I notice that you are using a netmask of on wlan0 and wlan1 (ifconfig output). Based on the IP addresses, I guess you want a netmask of (8-bit host number).

Generally, Linux does not like having multiple IP interfaces on the same network (unless they are bonded). Applying the netmast, you have two interfaces on the 10.x.x.x network. After you fix the network mask, you will have two networks, 10.0.11.x and 10.0.4.x.

| improve this answer | |
  • Same problem! Changed all interfaces to netmask, but the same behavior happens. One of the interfaces seems to not receive/transmit packets. – regisin Jul 10 '17 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.