1

I am attempting to set up a Ad-Hoc Wifi network of multiple PIs , none of them are supposed to be connected to the Internet. I could configure one of the PIs to act as a Ad Hoc Wifi device which provides the Wifi access point with an SSID and a static IP address.

I configured the /etc/interfaces file with the following text:

auto wlan0
iface wlan0 inet static
address 192.168.1.1
netmask 255.255.255.0
wireless-channel 1
wireless-essid CTWifi
wireless-mode ad-hoc

I can see the Wifi connection on another raspberry Pi through the Wifi connection GUI

I set up a static IP address (with the same subnet as the ad-hoc Pi) on the other raspberry pi by adding a line to the dhcpcd.conf file so I can connect to the ad-hoc Pi:

interface wlan0
static ip_address=192.168.1.2

However, I cannot seem to connect to CTWifi by clicking on it even though it is showing up in the GUI. I tried to change the wpa_supplicant.conf file but that does not work either.

I also tried to set up a DHCP server on the ad-hoc Pi following this guide: https://spin.atomicobject.com/2013/04/22/raspberry-pi-wireless-communication/

I added the following lines to the dhcpd.conf file on the ad-hoc Pi:

ddns-update-style interim;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;
subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.2 192.168.1.254;
}

It still does not work. I cannot seem to connect to the ad-hoc network through the Wifi GUI.

Any help will be appreciated. Thanks.

Can see CT Wifi but cannot connect to it by clicking on it

  • You do not seem to understand ad-hoc ALL devices need to be ad-hoc – Milliways Jan 13 at 4:56
  • Thanks. Now it works. I think my misunderstanding was that I did not understand that ad hoc means a routerless connection. – Anamitra Jan 13 at 15:20
  • Please make an answer for your solution and accept it after two days. Only accepting an answer will finish a question. Otherwise it will pop up again and again for years (and for nothing). – Ingo Jan 13 at 22:02
0

I set up the ad hoc settings in the other Pi with a static IP address and was able to able to connect to the network

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.