Arti G
Posts: 4
Joined: Sat Aug 05, 2017 2:57 pm

Access point on Raspberry Zero W

Sat Aug 05, 2017 3:36 pm

Hello
Is it possible to have access point on Raspberry Zero W? Do you know working tutorial? I tried one and I can see created network. I can connect with PC but it doesn't get IP from DHCP. I can't connect with smartphone because it also doesn't receive IP. I tried many tutorials and still same. Could you help?

User avatar
DougieLawson
Posts: 38547
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Access point on Raspberry Zero W

Sat Aug 05, 2017 3:41 pm

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Arti G
Posts: 4
Joined: Sat Aug 05, 2017 2:57 pm

Re: Access point on Raspberry Zero W

Mon Aug 14, 2017 6:22 pm

I tried it, but still I don't get IP.

Arti G
Posts: 4
Joined: Sat Aug 05, 2017 2:57 pm

Re: Access point on Raspberry Zero W

Thu Aug 31, 2017 9:27 am

So DHCP won't work on Raspberry Zero W? Only static IP?

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Access point on Raspberry Zero W

Thu Aug 31, 2017 10:12 am

The RPi needs to be assigned a static IP, but the other client devices on the localnet will be assigned network settings by the DHCP server on the RPi. That is what dnsmasq does.

Arti G
Posts: 4
Joined: Sat Aug 05, 2017 2:57 pm

Re: Access point on Raspberry Zero W

Thu Aug 31, 2017 7:40 pm

RPi as AP has static IP, but clients have to get dynamic IP from RPi. Any idea why client devices don't get IP by DHCP?

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Access point on Raspberry Zero W

Thu Aug 31, 2017 8:02 pm

If your clients are getting a dynamic IP, then they are using DHCP.

Edit: My bad. They are not getting an IP. Are you able to connect to the RPi AP with the clients, just not getting an IP?

Post the contents of /etc/dnsmasq.conf and /etc/dhcpcd.conf.

Jarrod
Posts: 20
Joined: Sat Sep 02, 2017 5:57 am

Re: Access point on Raspberry Zero W

Sat Sep 02, 2017 6:04 pm

Make sure you are using Raspbian Jessie, then the tutorial that Dougie linked above will work straight away on the Pi Zero W (up to but not including the section "USING THE RASPBERRY PI AS AN ACCESS POINT TO SHARE AN INTERNET CONNECTION"). Took me 20 minutes start to finish.

The existing tutorials don't work on the latest Raspbian (Stretch) images. Some (like Tim) have managed to get it working using the dhcpcd method to assign a static IP to your Pi Zero W WiFi interface, so it can be done. But I tried for hours and failed. The general release of Raspbian Stretch is still quite new and the details of configuring an AP with this system seem not to be fully nailed down just yet.

If the only thing that isn't working for you is having connected clients assigned an IP in the subnet of your access point, then look at your dnsmasq configuration. That's the piece of software responsible for handing out IPs to DHCP clients of your access point. For example, make sure it's setup to hand out IPs in the same network you have your wlan0 interface setup in.

User avatar
HermannSW
Posts: 2379
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Access point on Raspberry Zero W

Sat Sep 30, 2017 12:30 am

Remembered this thread when reading "SIMULTANEOUS AP & CLIENT ON THE PI ZERO W" today:
https://hackaday.com/2017/09/29/simulta ... pi-zero-w/
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Access point on Raspberry Zero W

Sat Sep 30, 2017 12:38 am

HermannSW wrote: Remembered this thread when reading "SIMULTANEOUS AP & CLIENT ON THE PI ZERO W" today:
https://hackaday.com/2017/09/29/simulta ... pi-zero-w/
Tried it yesterday, and it didn't work with Stretch. I haven't tried it with Jessie yet. Are you looking for just an AP, or the simultaneous client/AP on the one onboard device?

pohukai
Posts: 7
Joined: Mon Feb 22, 2016 2:34 am

Re: Access point on Raspberry Zero W

Sun Oct 01, 2017 9:50 pm

I have failed to get this to work and have spent days trying. I have followed these instructions but an access point still fails to show up on my android phone.

My goal is to be able to have the PI stream the video back to my phone. On another SD card, I have that working as I'd like, but it is useless to me unless I can stream it back to my phone.

Based on this thread, I gave up trying to use 'Stretch' working but having pulled down a fresh image of the jessie-lite, I still can not get it to work.

https://www.raspberrypi.org/documentati ... s-point.md

I'm almost ready to give up. Does anyone see an obvious issue? Here are my setting:

/etc/wpa_supplicant/wpa_supplicant.conf

Code: Select all

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

#network={
#  ssid="17117FF"
#  psk="7aRYZ"
#}
/etc/network/interfaces

Code: Select all

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet static
    address 192.168.0.1
    netmask 255.255.255.0
    network 192.168.0.0
    #wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

/etc/dnsmasq.conf

Code: Select all

interface=wlan0
dhcp-range=192.168.0.2,192.168.0.20,255.255.255.0,24h
/etc/hostapd/hostapd.conf

Code: Select all

interface=wlan0
driver=nl80211
ssid=PirateVirus
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=test
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
/etc/default/hostapd

Code: Select all

# Defaults for hostapd initscript
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
DAEMON_CONF="/etc/hostapd/hostapd.conf"

# Additional daemon options to be appended to hostapd command:-
#       -d   show more debug messages (-dd for even more)
#       -K   include key data in debug messages
#       -t   include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS=""

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Access point on Raspberry Zero W

Sun Oct 01, 2017 10:47 pm

That access point doc is out of date by at least a couple of versions. This is the correct doc for Jessie and Stretch.
https://github.com/SurferTim/documentat ... s-point.md

pohukai
Posts: 7
Joined: Mon Feb 22, 2016 2:34 am

Re: Access point on Raspberry Zero W

Sun Oct 01, 2017 10:57 pm

Resolved.... Here was the culprit!

This is the faulty link.....
https://frillip.com/using-your-raspberr ... h-hostapd/

The command:
sudo nano /etc/dhcpcd.conf and add the following line to the bottom of the file:

Code: Select all

denyinterfaces wlan0  

Thank you SurferTim!

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Access point on Raspberry Zero W

Sun Oct 01, 2017 11:23 pm

The difference is more than just that. It is where you assign network settings. If you use a bridge AP, that is different also. The way you add wlan0 to the bridge is with /etc/hostapd/hostapd.conf and the addition to /etc/network/interfaces.

stevieb
Posts: 2
Joined: Mon Feb 29, 2016 10:33 am

Re: Access point on Raspberry Zero W

Wed Nov 29, 2017 9:34 am

Just posting in case it saves someone else a few hours of pain trying to get this set up on a Pi Zero W. A sysadmin at work helped me track down the error to an unknown driver. When we editted

/etc/hostapd/hostapd.conf

and removed

driver=nl80211

it worked perfectly.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Access point on Raspberry Zero W

Wed Nov 29, 2017 11:32 am

stevieb wrote: Just posting in case it saves someone else a few hours of pain trying to get this set up on a Pi Zero W. A sysadmin at work helped me track down the error to an unknown driver. When we editted

/etc/hostapd/hostapd.conf

and removed

driver=nl80211

it worked perfectly.
Mine works perfectly with the driver=nl80211. I'm using Stretch 2017-09-07.

LewisCowles1986
Posts: 12
Joined: Fri Mar 18, 2016 9:24 pm

Re: Access point on Raspberry Zero W

Fri Jan 19, 2018 4:22 pm

I have a script for setting up access point on Raspberry Pi 3, I'm going to endeavour to make it work with the pi-Zero W as well because I now have one.

https://gist.github.com/Lewiscowles1986 ... 5b2029c390

There is also an interface passthrough script (potentially to be combined with USB-gadget mode ethernet interface, or USB ethenet dongle interface)

https://gist.github.com/Lewiscowles1986 ... f1b672c0c9

As per notes, these scripts were originally created pre-stretch release. There is another script below, used to fix the awful work done on dhcpcd that I've seen mess up so many tutorials.

https://gist.github.com/Lewiscowles1986 ... 0adfe04cdb

The script isn't stateless like Ansible, so I'd suggest using a vanilla raspbian that you've not modified at all.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Access point on Raspberry Zero W

Sat Jan 20, 2018 2:30 pm

LewisCowles1986 wrote:
Fri Jan 19, 2018 4:22 pm
As per notes, these scripts were originally created pre-stretch release. There is another script below, used to fix the awful work done on dhcpcd that I've seen mess up so many tutorials.
The dhcpcd service doesn't seem to mess with my tutorial.
https://www.raspberrypi.org/documentati ... s-point.md
It does fine with Stretch and the RPi Zero W.

It does have some weird quirks when using a usb wireless device though.

mrded
Posts: 5
Joined: Sat Feb 08, 2014 5:47 pm

Re: Access point on Raspberry Zero W

Tue Nov 13, 2018 11:45 pm

I made a docker container to make a hotspot. You may find it useful https://github.com/mrded/rpi-chat/tree/master/hotspot

Return to “Networking and servers”