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.