title: Raspberry Pi and Edimax 7811UN incompatibility in ad-hoc mode
body: <p>I am using the <strong>Raspberry Pi Model 2 B</strong> with 1 GB RAM with the <strong>EDIMAX nano USB Adapter</strong>. At first I was using <strong>NOOBS</strong> on the Rapsberry Pi and wanted to set up an ad-hoc network between two such Pi's.</p>
  
  <p>I tried configuring one of the RPi with the same configurations as mentioned below:</p>
  
  <pre><code>#etc/network/interfaces for pi-1 
  auto wlan0
  allow-hotplug wlan0
  iface wlan0 inet static
      address 192.168.50.1
      netmask 255.255.255.0
      wireless-channel 12
      wireless-essid pi-adhoc
      wireless-mode ad-hoc
  
  #etc/network/interfaces for pi-2
  auto wlan0
  allow-hotplug wlan0
  iface wlan0 inet static
      address 192.168.50.2
      netmask 255.255.255.0
      wireless-channel 12
      wireless-essid pi-adhoc
      wireless-mode ad-hoc
  </code></pre>
  
  <p>I have set <em>Pi-1</em> as a DHCP server (using the ISC-DHCP-Server Daemon) so that I can SSH into the Ad-hoc network to the Pi's for ease of accessibility through my Laptop. The DHCP Server configurations are as follows:</p>
  
  <pre><code>ddns-update-style interim;
  default-lease-time 600;
  max-lease-time 7200;
  authoritative;
  log-facility local7;
  
  option subnet-mask 255.255.255.0;
  option domain-name "pi-adhoc";
  subnet 192.168.50.0 netmask 255.255.255.0 {
  range 192.168.50.3 192.168.50.150;  
  }
  </code></pre>
  
  <p>and then run the daemon
  <strong>pi-1 ~$ sudo service isc-dhcp-server start</strong></p>
  
  <p>I also force the Pi's to join the ad-hoc network by configuring the <strong>rc.local</strong> files on both of them as follows:</p>
  
  <pre><code>#! /bin/bash
  # For Pi-1 /etc/rc.local
  adhocNetwork(){
      echo "connecting to ad hoc network"
      ifconfig wlan0 down
      iwconfig wlan0 mode ad-hoc
      iwconfig wlan0 essid pi-adhoc
      iwconfig wlan0 channel 12
      ifconfig wlan0 192.168.50.1 netmask 255.255.255.0 up
      echo "connected to ad hoc network"
  }
  adhocNetwork
  exit 0
  
  #! /bin/bash
  # For Pi-2 /etc/rc.local
  adhocNetwork(){
      echo "connecting to ad hoc network"
      ifconfig wlan0 down
      iwconfig wlan0 mode ad-hoc
      iwconfig wlan0 essid pi-adhoc
      iwconfig wlan0 channel 1
      ifconfig wlan0 192.168.50.2 netmask 255.255.255.0 up
      echo "connected to ad hoc network"
  }
  adhocNetwork
  exit 0
  </code></pre>
  
  <h2>Inferences</h2>
  
  <p>When I use my WiFi on my Laptop and connect to the <strong>pi-adhoc</strong> network created by the Pi's I get an IP address from the DHCP Server from the pool from Pi-1 and can ssh into the Pi-1 and just to check connectivity I can Ping the laptop from RPi to Laptop and vice versa.</p>
  
  <p>When I try to Ping Pi-2 from Pi-1, it is unreachable and vice versa. But I can connect to the Pi-2 from the Laptop and vice versa. </p>
  
  <p>Scenario: PI-1 &lt;---> Laptop and PI-2 &lt;---> Laptop 
  but NO connectivity from PI-1 &lt;--/--> PI-2
  I cannot connect the Pis together.</p>
  
  <p>I also upgraded the <strong>NOOBS</strong> to Wheezy using the following:
      sudo apt-get update
      sudo apt-get dist-upgrade</p>
  
  <p>But the Problem still Exists.</p>
  
  <p>Any help would be appreciated. Thanks.</p>