This bash
script performs the following:
-
Checks for the type of Pi:
- Raspberry Pi 2 Model B
- Raspberry Pi 3
-
Checks for either:
- internal wireless chipset for Pi - 3
- external wireless chipsets for Pi - 2
-
Adds appropriate kernel modules in the
/etc/modules
folder for boot -
changes the
/etc/rc.local
file for setting up an ad-hoc network on boot with following parameters:- Mode Ad-Hoc
- Channel 1
- ESSID
test-adhoc
- Tx power to 0dBm (if possible)
-
Changes the
/network/interfaces
file and other networking files to provide:- IPv6 SLAAC addresses on
wlan0
- no IPv6 addresses on
eth0
- IPv6 SLAAC addresses on
-
ONLY dongles with following drivers are capable to work in ad-hoc operation:
r8188eu
rt2x00lib
-
Edimax 7811UN with
8192cu
drivers are INCOMPATIBLE.
Pis can be accessible once running the script and rebooted using:
ping6 -I wlan0 ff02::1
from a native Linux PC with the Same ad-hoc network configuration or from a Pi with the same configuration. Pis are addressed with fe80::
link-local addresses.
to perform ssh
in to the pi:
ssh -l pi fe80::abcd:1ff:fe22:dead%wlan0
the %wlan0
is important
to perform scp
use []
as follows:
scp someFile.txt pi@[fe80::abcd:1ff:fe22:dead%wlan0]:/home/pi/
Just your Pi with an external chipset based USB dongle and root privileges to trigger the script.
sudo ./adhoc_setup.sh
-
r8188eu
chipsets are miserable with not letting the user settxpower
and alsochannel
parameters.txpower
will return an Error, whileaschannel
set to another value will not. -
even upon setting
sudo iwconfig wlan0 channel 06
or another value, only the default value of channel 1 i.e. 2.412 GHz is set.
Issued under MIT License