1

Okay, I am very much a NEWBIE when it comes to these type of connections. So, I searched on this website on how to be able to do this and I came across two promising questions and answers. However, they don't seem to be helping. First, I tried the following question's answer. Ad-hoc setup for pi 3 All I see is a tooltip saying the following for both PI 3 but with different ip address. With this setup, I can't make PIs talk to each other. I don't even know if they see each other even though they are supposed to be on the same network SSID (thayanet). I can't even PING from each other.

Wlan0 tooltip

Then, I tried the second question I found - Connect to Raspberry PI 3 over Wi-Fi direct This question also didn't help me. Once I made the changes wpa_supplicant.conf file, it spit out all sorts of errors such as unsupported drivers, failed to add interface wlan0, etc...

I simply want to setup a Ad-Hoc connection for my two PIs. So, they can communicate with each other. Any help is appreciated.

UPDATE Once I set up ad-hoc on one PI, the other PI sees that network. Now, how do I use this network setup. I try to connect the non-ad-hoc PI to ad-hoc PI and it won't connect.

ThN
  • 1,081
  • 6
  • 22
  • 37

2 Answers2

5

You can simply use the iwconfig tools on the both your Pis to join to an ad-hoc network.

use the following:

sudo iwconfig wlan0 mode ad-hoc channel 01 essid my-net

You can use your Link-Local addresses to interact with the pis in general.

A smart way to know your local network Pis can be to use:

ping -I wlan0 224.0.0.1

It is a Multicast Address which will give your pings from the Pis which have the same ad-hoc parameters.

This should most definitely give you the 169.254.x.x address of the Pi within the ad-hoc network.

Networking upon next boot

In best case use the following in your (both Pis) /etc/rc.local file:

sudo nano /etc/rc.local

iwconfig wlan0 mode ad-hoc essid my-net channel 01
exit 0

and add brcmfmac in to your /etc/modules file for availability of chipset on boot.

For further help I have a GitHub repository which can set up Pis (any model 2 or 3) in Ad-Hoc mode with IPv6 Link Local Addresses.

Shan-Desai
  • 1,541
  • 2
  • 13
  • 28
0

I've successfully done it using link-local networking.

Wiki page: https://en.wikipedia.org/wiki/Link-local_address

Some googling will let you know what needs to be set up. Since there is no DHCP server, each Pi needs a set static address (although it may auto-config and get it's own), and then be configured to access the other Pi via Wifi. I am not sure how to do this, I have only linked mine via Ethernet, but I am sure it's not terribly different.