0

I have a RPi in the car that I need to act as a mobile AP.

I need it to provide a consistent, unchanging ESSID (in AP mode) using the onboard wlan0 for all devices that stay in my car. Dashcams, the car's nav computer for instance. The Pi will also interface with the car over ODB2 to do some logging and remote control.

But to provide connectivity TO the Pi itself, I need to use my smartphone when it is plugged in (it provides a "USB NIC"). Or if my phone is not connected by cable, then I need the pi to use a secondary, usb Wifi adapter (wlan1) as a wifi client (client mode), to search for common APs at home, work, family's house, and join the strongest one.

Obviously linux does this all the time. My Fedora/CentOS/Ubuntu laptops simply have a gui list of networks, and when it's on, it finds something on that list and joins it automatically.

I want to have that same capability, in the Pi via commandline only scripting.

What's the best way to do that on a Pi Zero W?

I will probably also add an openvpn or openswan tunnel to this so that my car car can have an unchanging "public ip" that I could use with IFTTT or other services to make incoming connections. But that's beyond the scope of what I'm asking here. Obviously I know I need to keep it secure, again outside scope.

goldilocks
  • 56,430
  • 17
  • 109
  • 217
  • I don't see what the problem is. There are many tutorials to set up an AP on a Pi. Your query is very confusing as you add all sort of stuff that doesn't seem to be relevant to the core issue... Have you tried to set up an AP on your Pi already? – Dirk Jun 19 '21 at 20:36
  • this does not appear to be a Raspberry Pi specific question – jsotola Jun 19 '21 at 21:39
  • It's a raspbian qustion. I already have the AP ready. I provided extra context because I want you to be aware of otherthings you might break by saying just 'Use Network Manager like a desktop OS'. The question is this, and it had nothing to do with setting up an AP: How do I automate a non-gui wifi client to roam to the strongest AP in range? – Billy left SE for Codidact Jun 20 '21 at 14:48
  • Welcome. Most of the networking configuration questions here (there are over 2000 tagged "networking") do not refer to a GUI at all. "Selecting an AP" is done via `wpa_supplicant.conf`, the choice of uplink via `dhcpcd.conf` (see `fallback` and `profile` in `man dhcpcd`). If you are already competent with shell scripting, you may be interested in `man dhcpd-run-hooks`. There is probably already enough online documentation/discussion/etc on dhcpcd and wpa_supplicant for you to spend months or years reading, please don't ask people to produce more unless you are really stumped with something. – goldilocks Jun 20 '21 at 15:21
  • @BillyC. it is a Linux networking question ... not RPi specific – jsotola Jun 20 '21 at 20:35

0 Answers0