Jumpnow Technologies


Raspberry Pi 3 AdHoc Wifi Network

26 Dec 2016

If you are using O/S images built from my meta-rpi Yocto meta-layer you can setup an AdHoc wifi network by editing /etc/network/interfaces like this

root@rpi3:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback

#auto eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet static
        pre-up iwconfig wlan0 mode ad-hoc essid 'rpi'

After that you should see the following after reboot or restarting the network

root@rpi3:~# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr B8:27:EB:03:CE:89
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::ba27:ebff:fe03:ce89%2122906392/64 Scope:Link
          RX packets:475 errors:0 dropped:394 overruns:0 frame:0
          TX packets:123 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:73722 (71.9 KiB)  TX bytes:20828 (20.3 KiB)

root@rpi3:~# iw wlan0 info
Interface wlan0
        ifindex 3
        wdev 0x1
        addr b8:27:eb:03:ce:89
        ssid rpi
        type IBSS
        wiphy 0
        txpower 31.00 dBm

root@rpi3:~# iwconfig wlan0
wlan0     IEEE 802.11bgn  ESSID:"rpi"
          Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: D2:D4:86:A3:CA:E5
          Tx-Power=31 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on

And from a laptop running Fedora 25 also configured for an AdHoc network and with an IP address of I can communicate

 root@rpi3:~# ping
 PING ( 56 data bytes
 64 bytes from seq=0 ttl=64 time=8.259 ms
 64 bytes from seq=1 ttl=64 time=7.971 ms
 --- ping statistics ---
 2 packets transmitted, 2 packets received, 0% packet loss
 round-trip min/avg/max = 7.971/8.115/8.259 ms

 root@rpi3:~# ssh scott@
 scott@'s password:
 Last login: Mon Dec 26 11:44:24 2016 from
 scott@t410:~$ exit
 Connection to closed.