Steps to build mesh network on Raspberry pi

working commands to enable adhoc in Raspberry pi with edimax USB Wi-Fi dongle:

https://wiki.debian.org/WiFi/AdHoc


Some other links:



@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@             Steps to build mesh network on Raspberry pi                    @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@



1.
ethernet ip address for Ethernet ports on all mesh nodes:

10.10.1.10/24

the ethernet ports for mesh nodes are used as console ports to configure
the mesh.


in Mesh, we have "routing capabilities at the MAC layer".
Path selection is used to refer to MAC-addressbased routing and
to differentiate it from conventional IP routing.

########################
pre-requisites:
########################
a. enable vnc server in raspberry pi using "sudo raspi-config" command.
b. in this file /etc/dhcpcd.conf, add the below. This is to ensure that the
ethernet port of raspberry pi is always configured with static IP. Since,
mesh network should have a minimum for 4 nodes, it would be easy to login
into raspberry pi via back to back pi to laptop ethernet port. The laptop's
IP should be also configured in the same network. do the same for all the
mesh node device.

IN short, one laptop can be used to log into every raspberry pi (mesh node) !!!!!

# Example static IP configuration:
interface eth0
static ip_address=10.10.1.10/24
static ip6_address=fd51:42f8:caae:d92e::ff/64
static routers=10.10.1.1
static domain_name_servers=10.10.1.1 8.8.8.8 fd51:42f8:caae:d92e::1


########################
Actual Steps:
########################




1. buy  Wi-fi adapter "Edimax EW-7811Un Wi-Fi USB Adapter"


2. comment out this line from raspberry pi blacklist for enabling mesh (80211s
) for the above mentioned Wi-Fi chipset.

pi@raspberrypi:~ $ cat /etc/modprobe.d/blacklist-rtl8192cu.conf
#blacklist rtl8192cu
This device also supports monitor mode.




@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
how to check whether the required drivers for edimax are installed or not.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
pi@raspberrypi:~ $ lsmod | grep 8192cu
rtl8192cu              90112  0
rtl_usb                20480  1 rtl8192cu             
rtl8192c_common        69632  1 rtl8192cu         <---------------------------------------------
rtlwifi               114688  3 rtl_usb,rtl8192c_common,rtl8192cu
mac80211              692224  3 rtl_usb,rtlwifi,rtl8192cu



This site has list of wifi adapters:
https://github.com/phillymesh/802.11s-adapters

3.

Now that the wifi driver (edimax EW-7811Un) supports mesh, we are good to program the
mesh ESSID on each of the raspberry pi.

su
ifconfig wlan0 down
iwconfig wlan0 channel 1 essid neel_mesh mode ad-hoc
ifconfig wlan0 192.168.13.100 netmask 255.255.255.0
ifconfig wlan0 up

su
ifconfig wlan0 down
iwconfig wlan0 channel 1 essid neel_mesh mode ad-hoc
ifconfig wlan0 192.168.13.101 netmask 255.255.255.0
ifconfig wlan0 up


su
ifconfig wlan0 down
iwconfig wlan0 channel 1 essid neel_mesh mode ad-hoc
ifconfig wlan0 192.168.13.102 netmask 255.255.255.0
ifconfig wlan0 up


su
ifconfig wlan0 down
iwconfig wlan0 channel 1 essid neel_mesh mode ad-hoc
ifconfig wlan0 192.168.13.103 netmask 255.255.255.0
ifconfig wlan0 up


4.
Check whether the SSID that the node is transmitting is visible in the scan

iwlist wlan0 scan | grep ESSID