2

I followed this tutorial to set up my RPi 3 as an Access Point. It works great and I am able to connect through it and I can also VNC to it directly from my phone when in my car (which was the main aim).

However, I now need to revert it back to client mode so that I can connect to it through my home network when I am back home. To be precise, I need an easy way to switch between the two modes.

I tried to follow the instructions in this post but they seem to aimed at using isc-dhcp-server rather than dnsmasq like I am doing. #systemctl stop dnsmasq.service did not appear to do anything. Besides, I am stuck at the part where it says I have to "use wpa_supplicant as a service". The link points to a text file which I have no idea how to put to use. As things stand, if I click on the up/down arrows icon at the top right of the screen, it says "no wireless interfaces found".

My first priority is to switch back to client mode. I will worry about how to automate that later (although it would be cool if there was a single tutorial for doing both using the AP setup I used).

Chetan Bhargava
  • 1,264
  • 2
  • 15
  • 29
Osprey
  • 141
  • 2
  • 5

2 Answers2

1

If you do not have any reason to switch off the access point on the RasPi then you can just configure a client connection to your home network in addition to the access point. Then everything will work "automagically". If you at home the RasPi will connect by WiFi to your home network. If you are outdoors then there is just no connection. wpa_supplicant will manage autoconnect. How to setup it you can look at Access point as WiFi router/repeater, optional with bridge.

Ingo
  • 40,606
  • 15
  • 76
  • 189
1

I referenced the following link to come up with my procedure which worked for me:

https://hydrosysblog.wordpress.com/2016/08/07/rpi3-switch-between-wifi-ap-and-client/

sudo systemctl stop hostapd.service
sudo systemctl stop isc-dhcp-service
sudo ip link set dev wlan0 down
ctrl_interface=/run/wpa_supplicant
update_config=1
sudo ip link set dev wlan0 up
sudo ifup wlan0 #not sure if this command was needed or if the one before did the trick but I included it just in case