I have encountered a problem with my network setup. I have three Raspberry Pi 3s running Raspbian, a Windows 7 PC, and a Mac. I have the Raspberry Pis configured to automatically startup an ad-hoc network named "PiNetwork" on the built-in wireless card. I can then connect to the ad-hoc network on my Windows 7 PC and ping/ssh all of the Raspberry Pis. I can do the same on my Mac.
When I want to close the connection to the Pis from my Mac so that I can surf the internet, I simply click "Disconnect from PiNetwork" in the Network Manager. Doing this closes the connection to the Pis from the Mac, but the Pis can still talk to each other, and I can rejoin the network from the Mac if I want to.
If I try to close the connection to the Pis from my PC however, I choose PiNetwork in the wifi list and click the "Disconnect" button. Doing this closes the connection between the PC and Pis, but ALSO closes all of the ad-hoc connections. The Pis can no longer talk to each either, and nobody can reconnect to the network without restarting the Pis. This same problem occurs when the Windows PC is shutdown (properly) or restarted while connected to "PiNetwork". It does not occur however if I just pull the PC's power cord from the wall outlet.
I cannot seem to find a solution to this problem, and no other documentation that I have read has contained any helpful information.
My /etc/network/interfaces file for the ad-hoc network looks like this for the Pis. All devices are on the same subnet (XXX.YYY.Z), network, netmask, SSID, mode, channel, and key. The only thing that I change is the IP address for each Pi.
iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet static address XXX.YYY.Z.IP network XXX.YYY.Z.0 netmask 255.255.255.0 wireless-essid PiNetwork wireless-mode ad-hoc wireless-channel 5 wireless-power off wireless-key ************* iface default inet dhcp