I will refine this later so you can have a virtual network, that way you dont need the ugly ethernet setup.
You need the following to do this If you want to have the pi's connected to the internet. You can use SSH over the ad-hoc network (which was suprising).
- An ethernet cable for every raspberry pi you have
- An n + 2 port ethernet switch (for n pi's, 1 to your laptop, 1 to the router/internet)
- A laptop/desktop hub station for control (You can also use one of your Pi's for the control node)
Follow these steps
- Edit
/etc/network/interfaces
as root - Add the following into interfaces at the bottom of the file
auto lo iface lo inet loopback iface eth0 inet manual auto wlan0 iface wlan0 inet static address 192.168.X.X #Replace these X's with whatever you want netmask 255.255.255.0 wireless-channel 1 wireless-essid 439AdHoc wireless-mode ad-hoc
- restart your device.
sudo shutdown -r now
works just fine. This will disable eth0 (for some really weird reason). You are now on an ad-hoc network. But as mentioned above, the device is now acting strange on startup. The next two commands fix that - run
sudo crontab -e
, add the commandip link set <eth0> up
, replaceeth0
with whatever your ethernet port - edit
/etc/rc.local
, insertdhclient -v eth0
This will re-enable eth0 so you can connect via eth
If you are using a git repo and want to pull, you have two options.
- Pull from the internet (Requires some ethernet connection)
- Host a local gitserver (I havent gotten this to work yet, but google
git serve
)