Creating access point - Raspberry Pi Zero W

Hi, I’m looking to recreate the creation of an access point on the Zero W. I have USB > ethernet working fine and am trying to use Network Manager to manage the AP.

I have placed a file called resin-hotspot inside /boot/system-connections and my bash script runs export DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket before I try to activate the connection.

If I run ifconfig wlan1 down I get an error - wlan1: ERROR while getting interface flags: No such device (I specified the interface name to be interface-name=wlan1 in the config file).

Running the script results in - python ./ resin-hotspot

KeyError: 'resin-hotspot'

My config on the SD card is:






Conversation from Gitter (just a copy/paste/trim)

Alasdair Davies @Al2kA_twitter 09:47
Hi everyone. Has anyone managed to use NetworkManager on a Pi Zero W to bring up an access point? I have ethernet via USB as the primary connection and think I should be able to work in the container to start it using a Python script, but do I still need to set the config file on the SD card? -

Joseph Roberts @josephroberts 09:56
@Al2kA_twitter Raspberry-Pi Wifi Access-point - #5 by josephroberts

Alasdair Davies @Al2kA_twitter 09:57
@josephroberts Thanks so much. Will give that a try now.

Joseph Roberts @josephroberts 10:03
we also have a rust module if you would prefer that over python GitHub - balena-io-modules/network-manager: Rust NetworkManager bindings

Jon Nettleton @linux4kix 10:04
or via the commandline. Create Wi-Fi Hotspot on Linux using nmcli · GitHub

Joseph Roberts @josephroberts 10:07
@linux4kix that will work from the host but not from the user container
the only way to interact with network manager from the user container is via DBUS

Jon Nettleton @linux4kix 10:08
why not? as long as you export the system dbus socket

Joseph Roberts @josephroberts 10:09
can you provide a working example? This would be awesome if it does work
I think I tried before and struggled to get get nmcli in the container without network manager also being installed
and weird stuff happened when I had network manager in both the host and user container

Alasdair Davies @Al2kA_twitter 10:10
@josephroberts it certainly would. Happy to reproduce here to confirm

Joseph Roberts @josephroberts 10:10

Jon Nettleton @linux4kix 10:12
I am not in front of a resinos machine right now. Is /var/run/dbus being mapped into the container by default?
ah there it is.
export that and nmcli should work for you

Joseph Roberts @josephroberts 10:14
How would you install nmcli without also installing network manager?

Jon Nettleton @linux4kix 10:21
so I would do the same thing for nmcli and any other libraries needed

Joseph Roberts @josephroberts 10:21
build from source you mean?

Jon Nettleton @linux4kix 10:22
basically install networkmanager from alpine linux, and then move the binaries and libraries over to be packaged.
you could build from source, but I think that would be excess work.
the other option is just add the hotspot networkmanager config but don’t have it autostart. Then use dbus to bring the connection up and down.

Joseph Roberts @josephroberts 10:26
yeah its a nice idea, will add it to my list of potential hack Friday projects. cheers

Frans van Hoogstraten @FransvanHoogstraten 11:16
@linux4kix Thanks for the info, will immediately give it a test!

Jon Nettleton @linux4kix 11:29
great. let me know if you run into any snags

Alasdair Davies @Al2kA_twitter 11:36
@FransvanHoogstraten would love to know how you get on. In the meantime I am seeing how I get on with the DBUS API way.

Alasdair Davies @Al2kA_twitter 14:58
@linux4kix @josephroberts what’s you thought on this? (exporing DBUS_SYSTEM)

Jon Nettleton @linux4kix 15:01
@Al2kA_twitter thanks for the link but that script looks extremely hackish, and you can have wireless enabled but not in AP mode, so will only work in very specific circumstances.

Joseph Roberts @josephroberts 15:01
@Al2kA_twitter that was how I did it before I realised Network Manager supports AP mode
really not recommended anymore

Alasdair Davies @Al2kA_twitter 15:22
@linux4kix @josephroberts thanks both

Alasdair Davies @Al2kA_twitter 17:42
@josephroberts could you take a quick glance at my setup? I’ve added the local config to the SD, pip installed python-networkmanager and am using the example activate_connection in NetworkManager but no luck. Anything I’ve missed? -GitHub - arribada/access-point-dev: Testing access point creation on Pi Zero W

Joseph Roberts @josephroberts 18:01
@Al2kA_twitter do you get any output from the activate_connection script? where do you put the config file on the SD?
I would advice getting a dev image as then you can ssh into the host and use nmcli to debug
for example; nmcli c should show the resin-hotspot connection, nmcli d should show the interfaces and their names
then you can use nmcli c up id resin-hotspot to start the hotspot - if that works then your config is fine and the issue is somewhere else
if it doesn’t work you know where to concentrate your debugging

Alasdair Davies @Al2kA_twitter 18:05
@josephroberts will do. I get wlan1: ERROR while getting interface flags: No such device if I run ifconfig wlan1 up/down and the output from the activate_connection running python ./ resin-hotspot is KeyError: ‘resin-hotspot’

Joseph Roberts @josephroberts 18:06
that error tells me two things. first, your interface is not called wlan1

Joseph Roberts @josephroberts 18:07
secondly, the config file you have created has an error - thats where the keyerror thing comes from

Alasdair Davies @Al2kA_twitter 18:07
OK, will double check and more to a forum post

Are you on a -dev image yet, that unlocks a load of debug potential, especially for the host OS. This would make debugging this sort of feature that has to cross the host/container boundary much easier. Indeed the final post on the thread Joe referenced (Raspberry-Pi Wifi Access-point) is an excellent starting point.

Hi guys. I was on a production img, but fired up a dev image and ssh’ed in so I could take a look.

I noticed right away that I was replacing the UUID in the resin-hotspot config with the full UUID of the resin device, which I now believe is wrong. Doing so also caused the config to fail.

Output from nmcli and nmcli c and nmcli d below;

root@71387c9:~# nmcli c
NAME                UUID                                  TYPE             DEVIC                                 E
Wired connection 1  0fc345f2-d7ab-36e7-a4c7-8408b1267146  802-3-ethernet   eth0                                  
resin-hotspot       36060c57-aebd-4ccf-aba4-ef75121b5f77  802-11-wireless  --                                    
resin-sample        bcb05b81-52cb-3828-8088-c0f55e950375  802-11-wireless  --                                    
root@71387c9:~# nmcli d
eth0       ethernet  connected  Wired connection 1
docker0    bridge    unmanaged  --
lo         loopback  unmanaged  --
resin-vpn  tun       unmanaged  --

root@71387c9:~# nmcli
eth0: connected to Wired connection 1
        "ASIX Elec. AX88x72A"
        ethernet (asix), 00:0E:BA:01:A2:D6, hw, mtu 1500
        ip4 default
        inet6 fe80::ad0d:e783:b338:5a75/64

docker0: unmanaged
        bridge, 02:42:3D:5B:C5:48, sw, mtu 1500

lo: unmanaged
        loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536

resin-vpn: unmanaged
        tun, sw, mtu 1500

DNS configuration:
        interface: eth0

Ahh, so progress.

I now get (on production - leaving the UUID as it was)

root@4cfc0a0:/usr/src/app# export DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket
root@4cfc0a0:/usr/src/app# python resin-hotspot
No suitable and available 802-11-wireless device found

Which is exactly where the trail goes cold on the original forum thread - Raspberry-Pi Wifi Access-point

Hopefully my nmcli outputs will help identify the issue.

Update. After nmcli showed no wlan0 at all, I swapped the Zero W for another W and it showed. Could be a failure on that actual device. Now continuing to see if I can activate the AP on this.

root@71387c9:/# nmcli
eth0: connected to Wired connection 1
        "ASIX Elec. AX88x72A"
        ethernet (asix), 00:0E:BA:01:A2:D6, hw, mtu 1500
        ip4 default
        inet6 fe80::3ad1:6379:dad6:bee3/64

wlan0: disconnected
        "Broadcom "
        1 connection available
        wifi (brcmfmac_sdio), 9A:72:95:B5:F0:56, hw


Changed to wlan0 as reported and the AP is now created as expected. Looks like a hardware issue on the first device.

Thanks for the advice to use a dev img so I could debug. Worked a treat.


Hi all,
I am trying to create an access point with my Raspberry Pi 2 using a 4G USB Verizon modem. I was able to do it using the following guide:

Now I want to integrate this feature into my Resin application. I have read this thread and another one posted on this forum, I have read also the NetworkManager feature that resin uses but I do not have a clear idea how to properly make it work. Do you guys have a dummy guide like the one I shared before to guide me?

Thanks in advance

we don’t have such a guide yet.
The idea is to use network-manager.
You’ll need 2 files in the system-connections folder of the boot partition of your device image.

  • one will be for the wifi hotspot, similar to what you’ve seen in this thread or in Raspberry-Pi Wifi Access-point
  • the other will be for the 4G connection

If you run a Linux distribution using NetworkManager, you can try configuring your 4G modem and wifi hotspot using the graphical interface and then look at the files it created in /etc/NetworkManager/system-connections/

Using a dev image might help for debugging.

Zvin thanks for the info, I will try with a Linux Distribution and see what I can get. On the other side I have still a couple of doubts. I understand the configuration files, one for the access point and one for the USB modem, but I have still not a clear idea if I have to create a script to run some commands or not.

Are the two scripts in network-manager enough to make it work?

You shouldn’t need anything more than these 2 NetworkManager configuration files.

It think the role of a PiZW is better served as a small network services module. Yes you can enable to WLAN 0-1 devices. I’ve had my Zw’s a while. When I next drag them out of the drawer, I’m going to put the current “neuvo” honey pot on one, and perhaps bind on the other. IDK if there is a local Dynamic DNS tool for Raspbian, but that would be cool too. Bind everything to MAC addresses. Much more “pleasant” IMHO. Good luck to you!