0

I have been following this amazingly detailed guide but keep hitting a roadblock.

I am trying to create without the bridge.

I have run apt update and apt full-upgrade. AP gets created and I can connect but there is an issue with the client in that it just doesn't connect. I have run networkctl which gives the following

IDX LINK             TYPE               OPERATIONAL SETUP     
  1 lo               loopback           carrier     unmanaged 
  2 usb0             gadget             off         unmanaged 
  3 wlan0            wlan               no-carrier  configuring
  4 ap0              wlan               routable    configured

I've checked SSID and PSK and they are correct.

I have been through the troubleshooting section but it seems to mainly apply to issues with the AP part, not the client part. I have also tried to add the bridge capabilities and, strangely, the AP is still visible, I can connect to it and get an IP address but then can't connect via ssh or VNC. I suspect this is because the bridge is attempting to forward the connections?

Any idea how I can fix the client mode?

Also, when it's working, will it be possible to scan available networks using a python package such as wifi? Or is there a straightforward way of dynamically searching and connecting to networks?

  • I'm just preparing my test RasPi and will look at it. Just a moment please... – Ingo Jun 11 '20 at 10:19
  • You are using Raspbian Buster. It's too much effort for me to downgrade. I will test with the latest Raspberry Pi OS. I think it doesn't make a difference. – Ingo Jun 11 '20 at 10:26
  • Thanks so much @Ingo . From a quick look, the current Raspberry Pi OS current version is based Debian Buster so it's likely functionally the same (read: should be fine). – Bassline Soup Jun 11 '20 at 10:36

1 Answers1

1

I have checked the setup of an Access point as WiFi router/repeater without the bridge of the wired interface. It is working without any issues, in particular the uplink client connection is working.

I suppose your problem with the client uplink is just the connection to your internet router. I suggest to only setup and test this connection without an access point to reduce complexity and avoid side effects. Please Use systemd-networkd for general networking and follow section ♦ Create interface file for a WiFi connection. It must work before adding the access point to the cofiguration. To be on the save side with a clean starting point I would use a spare SD Card and flash a fresh Raspberry Pi OS (32-bit) Lite to it.

Ingo
  • 40,606
  • 15
  • 76
  • 189
  • Thanks Ingo. I have tried again with my version of Raspbian and it didn't work but worked with both lite and desktop of the current Pi OS versions. I think that because my image had connected to the WLAN previously (presumably using dhcpcd) that this created an issue. Can you recommend the best way to dynamically scan and connect to SSID's with this config? And to dynamically create AP? Thanks for your help! – Bassline Soup Jun 12 '20 at 11:04
  • What is very strange is I was playing around with various settings and decided to start from scratch so re-flashed OS and did everything again. I have since tried about 8 times both with Lite and Desktop just to do client connection without AP and just can't get it to work! I'm following everything to the letter and it doesn't make sense why it worked first time and now I have no luck – Bassline Soup Jun 12 '20 at 15:58
  • @BasslineSoup Look for possible error messages with `systemctl status systemd-networkd.service`, `systemctl status wpa_supplicant@wlan0.service` and `journalctl -b -e`. You can also start wpa_supplicant in debug mode. Look at the end of this answer: [How to correctly restart wpa_supplicant debug with networkd-systemd?](https://raspberrypi.stackexchange.com/a/89729/79866). – Ingo Jun 12 '20 at 16:58
  • Thanks Ingo! `systemctl status wpa_supplicant@wlan0.service` gave me a few errors. It turns out I was using the wrong type of double quotes! I didn't even know there were different types! I knew there was a backtick vs inverted comma but not curly double quotes vs straight! Might be worth adding a small note to your other tutorial as it could be an easy trip-up. Cool, back to where I was this morning! Now any ida the best approach for dynamically changing the WLAN without rebooting? And for dynamically creating AP? Thanks again! – Bassline Soup Jun 12 '20 at 17:59
  • @BasslineSoup For changing the WLAN without rebooting you can use `wpa_cli --help | less`. What do you mean with "dynamically creating AP"?. You can use the commands `ip`, `iw` and `systemctl` to create an AP by hand. – Ingo Jun 12 '20 at 18:12
  • I mean changing the ap SSID/PSK dynamically without rebooting. (Btw I wasn’t blaming your tutorial for the quote issue, that was completely my fault!) – Bassline Soup Jun 12 '20 at 18:53
  • @BasslineSoup `sudo systemctl stop hostapd.service`, modify /etc/hostapd.conf, `sudo systemctl start hostapd.service`. – Ingo Jun 13 '20 at 07:41
  • Thanks Ingo. I think I have worked out how to manipulate both client mode and ap mode dynamically using a combination of wpa_cli, and to disable the AP I am running `sudo hostapd_cli disable`, then editing the hostapd-conf file if required and then restarting with `systemctl restart hostapd.service`. This seems to allow client mode to only be down very temporarily when hostapd restarts. The only thing I can't work out is how to make hostapd initially load as if `sudo hostapd_cli disable` has been run? Basically when rpi boots I want the ssid disabled until I manually restart hostapd? – Bassline Soup Jun 15 '20 at 14:15
  • @BasslineSoup If there are still questions open, please create a new question. – Ingo Jun 15 '20 at 16:27