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/modulesfolder for boot -
changes the
/etc/rc.localfile 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/interfacesfile 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:
r8188eurt2x00lib
-
Edimax 7811UN with
8192cudrivers 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
-
r8188euchipsets are miserable with not letting the user settxpowerand alsochannelparameters.txpowerwill return an Error, whileaschannelset to another value will not. -
even upon setting
sudo iwconfig wlan0 channel 06or another value, only the default value of channel 1 i.e. 2.412 GHz is set.
Issued under MIT License