Search code examples
networkingraspberry-piwirelessadhocmesh-network

Wireless mesh networking on Raspberry Pi using batman-adv protocol


So I'm trying to setup a wireless mesh network using Raspberry Pi's, with the Edimax EW-7811Un WLAN Adapter and the batman-adv protocol.

I've tried following the basic setup guides from:

Unfortunately, when I get to the point where I need to ping one node from the other, I get

Destination Host Unreachable.

Running the batctl o command displays

'no batman nodes in range'

However, when running iwconfig, both nodes appear to be associated with the network I've setup, and when running iwlist wlan0 scan, the network I've setup appear as cells on both nodes.

I'm now at a loss as to how to proceed. I have read some articles on issues with ad-hoc support for Linux WLAN adapter drivers. My adapter is using the RTL8192CU driver. Could this be the cause of the issue?

P.S. I have looked at the following post, but this was no help, unfortunately.

Edit: contents of /etc/network/interfaces:

Both currently setup nodes have the same contents:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Edit: contents of /etc/wpa_supplicant/wpa_supplicant.conf for both nodes:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

Edit: ifconfig, iwconfig, and route for both nodes:

Node 1

ifconfig

wlan0    Link encap: Ethernet  HWaddr 80:1f:02:9b:bc:6c
         inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:0  errors:0  dropped:1  overruns:0  frame:0
         TX packets:0  errors:0  dropped:0  overruns:0  carrier:0
         collisions:0  txqueuelen:1000
         RX bytes:0  (0.0 B)  TX bytes: 0  (0.0 B)

iwconfig

wlan0    IEEE 802.11bg  ESSID:"pi-ad-hoc" Nickname:"<WIFI@REALTEK>"
         Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: 02:11:87:A1:CD:FF
         Bit Rate:54 Mb/s   Sensitivity:0/0
         Retry:off    RTS thr:off    Fragment thr:off
         Encryption key:off
         Power Management:off
         Link Quality=2/100  Signal level=2/100  Noise level=0/100
         Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
         Tx excessive retries:0  Invalid misc:0  Missed beacon:0

route

Kernel IP routing table
Destination    Gateway        Genmask        Flags  Metric  Ref    Use  Iface
192.168.2.0    *              255.255.255.0  U      0       0        0  wlan0

Node 2

ifconfig

wlan0    Link encap:Ethernet  HWaddr 80:1f:02:da:2e:ee
         inet addr:192.168.2.3  Bcast:192.168.2.255  Mask:255.255.255.0
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:0  errors:0  dropped:0  overruns:0  frame:0
         TX packets:6  errors:0  dropped:0  overruns:0  carrier:0
         collisions:0  txqueuelen:1000
         RX bytes:0  (0.0 B)  TX bytes:0  (0.0 B)

iwconfig

wlan0    IEEE 802.11bg ESSID:"pi-ad-hoc"  Nickname:"<WIFI@REALTEK>"
         Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: 02:11:87:2F:D6:FF
         Bit Rate:54 Mb/s   Sensitivity:0/0
         Retry:off  RTS thr:off  Fragment thr:off
         Encryption key:off
         Power Management:off
         Link Quality=2/100  Signal level=2/100  Noise level=0/100
         Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
         Tx excessive retries:0  Invalid misc:0  Missed beacon:0

route

Kernel IP routing table
Destination    Gateway        Genmask        Flags  Metric  Ref     Use   Iface
192.168.2.0    *              255.255.255.0  U      0       0         0   wlan0

Solution

  • I just checked your configuration with two Raspberries and the same Wifi Adapters (Edimax EW-7811Un) on Raspbian. Long story short: I get the same results as you do.

    My findings are as follows

    1. Setting up one Raspberry for adhoc as described and connecting from IPad or Notebook ... works fine
    2. Creating an adhoc connection on the Notebook and let one Raspberry join ... works fine
    3. Setting up one Raspbery for accesspoint and connecting from IPad or Notebook ... works fine
    4. However when setting up two Raspberries either in adhoc mode or accesspoint mode wont connect to each other ... doesnt work!
    5. As you figured out by this source here the available modes of these adapters (rtl8192cu) are unclear.
    6. Other sources create adhoc connections easily with similar setup and other wifi adpater like described.

    It pretty much seems like the adapters drivers won't allow this connection.

    Please note: setting up an accesspoint with these adapters requires a special compiled hostapd: read here to find out how