0

I'm trying to set up Pi Zero W as a wireless client in an embedded application that will first allow a user to log in to a hot spot, then select a WiFi router accessible by the Pi, log in to the selected network, and then have the Pi convert to a WiFi client on that network once credentials are accepted. I know how to set up the wireless hot spot, but the rest is a blur.

I found a reference for toggling a hot spot at Disable WiFi (wlan0) on Pi 3. I don't understand how to switch the state of wlan0 and antenna between modes while maintaining contact with the user who has logged in. Help would be much appreciated. Thanks for the responses.

I am trying to follow https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md but get to "To configure the static IP address, edit the dhcpcd configuration file with: " and stuck. There is no file /etc/dhcpcd.conf to edit. I can easily create one, but think I may be missing something.

Sorry for the confusion. Let me try again.

  1. RPi Zero W is initially set up as stand-alone hot spot and DHCP server. (I know how to do this.)
  2. User signs in to RPi hot spot.
  3. RPi then reassigns wlan0 (?) to WiFi client and surveys available WiFi networks.
  4. RPi loads SSIDs into memory.
  5. User selects SSID and logs in. RPi records log in information.
  6. RPi then converts itself from hot spot to WiFi client on the selected network.

I'm trying to do completely wireless what is ordinarily done to select and log into a wireless network while connecting a RPi to a keyboard and mouse.

I understand how to do the individual functions in 1, 2, 4, and 5. Accomplishing 3, and transitions from 2 to 3, and 3 to 4 are beyond me. Does wlan0 get reassigned? Does, for example, /etc/hostapd/hostapd get rewritten several times to accomplish the transitions from hot spot to WiFi client?

Signing on to the RPi hot spot is a one time event, to connect the RPi to the user-managed WiFi. After that, the RPi merely sits on the network and generates video. – fperkins 3 hours ago

I hope that is clearer. Thanks for the help.

Mats Karlsson
  • 973
  • 3
  • 11
fperkins
  • 19
  • 1
  • 4
  • 1
    Have you mistyped somewhere? I'm struggling to follow the description of the problem which has no mention of a hotspot, but you say you've got the hotspot working... – Mark Smith Apr 11 '19 at 19:58
  • As far as I understand you want to connect with the RasPi to a remote hotspot. On that hotspot then you can select a wifi router. Once selected the RasPi will disconnect from the hotspot and then connect to the other selected remote wifi router. Can you confirm this? How many wifi router are selectable on your network? Please address me with @Ingo, otherwise I won't see your reply. – Ingo Apr 11 '19 at 20:13
  • Please see additional comments above. Thanks. – fperkins Apr 12 '19 at 20:43
  • Please again, address me with **@Ingo**, otherwise I don't see your reply and I can't help you. Seeing this was luck. Yes, it gets a bit clearer with the update. But I do not understand how step `2) User signs in to RPi hot spot` to step `3) RPi then reassigns wlan0 (?) to WiFi client` should work. If you reassign the hot spot to a client connection then the hot spot is gone and the connected User is kicked out and cannot select a SSID. – Ingo Apr 12 '19 at 23:31
  • @Ingo, Thanks. Yes, that is what I want to happen. Signing on is a one time event to connect the RPi to the user-managed WiFi. After that, the RPi merely sits on the network and generates video. – fperkins Apr 13 '19 at 15:37
  • Not sure what "address me with @Ingo" means. New to this forum. – fperkins Apr 13 '19 at 15:44
  • You did it right in the comment before. You should write this five characters **@Ingo** anywhere into the comment if you want that I shall read it. – Ingo Apr 13 '19 at 19:45
  • I think OP just wants the initial hotspot to configure the pi (such as telling it which other network to hop to at a later point). User can then also connect to the new network after. At least thats what constraints to reality suggest... As for 'maintaining connection with the user' If you have access to what the user is using, it needs to ignore the gap in connection while the network changes. – Abel Oct 01 '20 at 02:27

1 Answers1

1

If I understand right what you want to achieve then it is not possible. You wrote:

 1. RPi is working as access point               OK
 2. User signs in to RPi access point            OK
 3. RPi then reassigns wlan0 to WiFi
    client and surveys available WiFi networks   OK
 4. RPi loads SSIDs into memory                  OK
 5. User selects SSID and logs in              **impossible!**

The user cannot do anything on the RasPi in particular selecting a SSID. On step 2. to step 3. the access point has shut down to establish a client connection of the RasPi. A user can only connect to an access point so on switching the interface wlan0 from an access point to a client connection, the users connection to the non existing access point will break.

Ingo
  • 40,606
  • 15
  • 76
  • 189
  • I think you have misunderstood "5. User selects SSID and logs in. RPi records log in information.", it must be "Select SSID and apply login credential to selected SSID" and that is feasible. – Mats Karlsson Sep 30 '20 at 16:58