title: Wireless mesh networking on Raspberry Pi using batman-adv protocol
body: <p>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.</p>
  
  <p>I've tried following the basic setup guides from:</p>
  
  <ul>
  <li><a href="http://www.open-mesh.org/projects/batman-adv/wiki/Quick-start-guide" rel="nofollow noreferrer">http://www.open-mesh.org/projects/batman-adv/wiki/Quick-start-guide</a></li>
  <li><a href="http://mindofdes.blogspot.co.uk/2013/02/raspberry-pi-raspbian-wireless-and.html" rel="nofollow noreferrer">http://mindofdes.blogspot.co.uk/2013/02/raspberry-pi-raspbian-wireless-and.html</a></li>
  </ul>
  
  <p>Unfortunately, when I get to the point where I need to ping one node from the other, I get </p>
  
  <blockquote>
    <p>Destination Host Unreachable.</p>
  </blockquote>
  
  <p>Running the <code>batctl o</code> command displays </p>
  
  <blockquote>
    <p>'no batman nodes in range'</p>
  </blockquote>
  
  <p>However, when running <code>iwconfig</code>, both nodes appear to be associated with the network I've setup, and when running <code>iwlist wlan0 scan</code>, the network I've setup appear as cells on both nodes.</p>
  
  <p>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>
  
  <p>P.S. I have looked at <a href="https://stackoverflow.com/questions/15423325/raspberry-pi-ad-hoc-networking">the following post</a>, but this was no help, unfortunately.</p>
  
  <p>Edit: contents of <code>/etc/network/interfaces</code>:</p>
  
  <p>Both currently setup nodes have the same contents:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Edit: contents of <code>/etc/wpa_supplicant/wpa_supplicant.conf</code> for both nodes:</p>
  
  <pre><code>ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
  update_config=1
  </code></pre>
  
  <p>Edit: <code>ifconfig</code>, <code>iwconfig</code>, and route for both nodes:</p>
  
  <h3>Node 1</h3>
  
  <pre><code>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:"&lt;WIFI@REALTEK&gt;"
           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
  </code></pre>
  
  <h3>Node 2</h3>
  
  <pre><code>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:"&lt;WIFI@REALTEK&gt;"
           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
  </code></pre>