I've had a hard time finding resources on getting a Raspberry Pi Zero W to operate simultaneously as and AP and WiFi client. I pooled together whatever resources I found that failed me, but got part of the way there, and figured out the rest on my own. I figured it would be a good thing to share, since there appear to be a lot of people asking how to do it, and not a lot of solutions out there.
When doing assigning you own fictional MAC I would recommend using locally administered addresses. It's basically just one bit flip: <a href="https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local" rel="nofollow">https://en.wikipedia.org/wiki/MAC_address#Universal_vs._loca...</a><p><pre><code> x2-xx-xx-xx-xx-xx
x6-xx-xx-xx-xx-xx
(... etc)
</code></pre>
And a question do you know why ap0 doesn't show up in you iw dev command? It seems you are only changing the addr not the device name.
I recently did the same thing and have packaged it all up as an Ansible setup script [1]. We're using it for a Pi based robot arm [2], so having a built-in access point and a web interface to use for configuring the WiFi means you don't need to rely on the user plugging in any peripherals. Works well!<p>Incidentally, the framework (headlessPi [3]) we use to run "apps" in the browser and configure the system is all open source and easy to configure for your own use.<p>[1] <a href="https://github.com/headlessPi/headlessPi-setup" rel="nofollow">https://github.com/headlessPi/headlessPi-setup</a>
[2] <a href="https://mime.co.uk/products/mearm-pi/" rel="nofollow">https://mime.co.uk/products/mearm-pi/</a>
[3] <a href="https://github.com/headlessPi/headlessPi" rel="nofollow">https://github.com/headlessPi/headlessPi</a>
That's great! One thing I've always wanted to build is an open source project to manage wifi on Raspberry Pis, with a similar user experience to Chromecast. It would be really useful as a base for hobby projects, as well as real products.<p>The idea is that if wifi is not configured or can't connect, then the Raspberry Pi would switch to AP mode. When you connect to the SSID, you would see a web page where you can configure your home wifi SSID and password, or choose a network from a list.<p>Does something like this already exist? I think it could be used in a lot of different projects, including RasPlex [1] and RetroPie [2]. I haven't looked at those projects for a while though, so maybe they already have that feature.<p>[1] <a href="http://www.rasplex.com/" rel="nofollow">http://www.rasplex.com/</a><p>[2] <a href="https://retropie.org.uk/" rel="nofollow">https://retropie.org.uk/</a>
Very nice work! Just curious what the range is like (client and AP) and if you have noticed any performance decrease vs your normal internet connection.
does this behave sanely if the pi-zero is taken out of range of the AP it's connected to? Are the connections between the pi-zero and its' clients preserved in that case?<p>I'm just now finding this when i'm about to hit the hay -- so I lack the cognition to go through it -- but i'd like something like this for a project of mine that involves a pi-zero-w that needs to maintain a connection with my cellphone while on the go -- and dump data when within range of a known AP.
I am curious about the existing issue when running these two modes simultaneously. Is this related to the network chipset that makes it harder vs a common PC card?
This is fantastic! Thank you for sharing. I was going to start looking into this for IoT applications myself.<p>I need to have a fail-safe where one device will usually be connected to WiFi and other devices may not for a myriad of reasons.