1

I have seen the tutorials for creating a stand alone network on raspberry pi like the one on The Raspberry Pi site and the nice tutorial in this previously asked question but what is not clear to me is if there is an easy way to turn that stand alone network off afterwards and use the WiFi as a client again. My goal with this is to create different modes for my raspberry pi so for example if it is connected to Ethernet it will start up the stand alone network but if not it uses the WiFi as a client to connect to the internet that way it always has internet but if it doesn't need the WiFi for internet it creates a WiFi network

Binvention
  • 123
  • 6
  • As shown in my answer I see two solutions but don't know what's the best for you: switch mode or simultaneous mode. Is it possible that the access point is always on but it clients get only into the internet when the ethernet cord is plugged in? The client connection is also always on but only connected to the remote access point if it is nearby? – Ingo Jan 05 '19 at 01:24

1 Answers1

2

You can switch off the access point, reconfigure the wifi interface and use it as client connection to the internet router. But you have to worry about what mode actually to use. There are two simple commands to switch between the modes without rebooting. How to set it up you can look at Swapping between wifi client and access point?. But this does not completely fit to your needs because the wired interface eth0 isn't configured yet.

You can also use both modes simultaneously by using an Access point as WiFi repeater, optional with bridge. But this also does not exactly fit your needs because the usage of the interface eth0 must be changed from a member of a brigde to an uplink.

If I know what's the best solution for you I will invest into it and update this answer.

Ingo
  • 40,606
  • 15
  • 76
  • 189
  • I tried using the swapping between wifi client and access point combining it with the nat routing from setting up raspberry pi as an access point but both the client and and the access point give a failed status when i try to start them – Binvention Jan 05 '19 at 03:34
  • Okay nevermind I got it working for some reason it liked double quotes better than singles quotes for ssid and password – Binvention Jan 05 '19 at 03:50
  • With this solution is there any way to get the raspbian description to still recognize the WiFi networks and connect to those networks – Binvention Jan 06 '19 at 01:07
  • What Raspbian description do you mean? To recognize WiFi networks you have to switch to client connection and then have a `network` stanza for each wlan in `/etc/wpa_supplicant/wpa_supplicant*.conf`. If switched to access point there is no way to recognize other WiFi networks to connect to because you are only using one interface **wlan0**. You may consider to use simultaneous mode. Then the interface **wlan0** for client connections (AP uses **ap0**) is always on so you are able to recognize WiFi networks all the time. – Ingo Jan 06 '19 at 01:32
  • I mean when I am in client mode the networking GUI built into the raspbian desktop doesn't recognize the networking interface at all – Binvention Jan 06 '19 at 01:34
  • The command line works great but the GUI stopped working – Binvention Jan 06 '19 at 01:35
  • Yes, that is a limitation at the moment. The GUI is build on default network setup and that isn't `systemd-networkd`. Have a look at the "intro" of [Howto migrate from networking to systemd-networkd with dynamic failover](https://raspberrypi.stackexchange.com/a/78788/79866). – Ingo Jan 06 '19 at 01:43