2

I am having problems to set up an accesspoint on my raspberry 3.

The purpose is, that I want a MQTT server runnig on the pi and other devices should connect to the pi. I need no bridge to the internet or similiar things, just a connection between my mqtt server (pi) and the clients. The whole setup needs to be portable, so whereever the pi boots up a SSID should be visible and accesable.

I found these two links:

https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md

https://www.raspberrypi.org/forums/viewtopic.php?t=191453

I started with a fresh raspian stretch image. Like suggested I installed dnsmasq and hostapd and made the following changes:

In /etc/dhcpcd.conf:

interface wlan0
static ip_address=192.168.4.1/24
static routers=192.168.4.1
static domain_name_servers=8.8.8.8

In /etc/dnsmasq.conf:

interface=wlan0
domain-needed
bogus-priv
dhcp-range=192.168.4.2,192.168.4.20,24h

In /etc/hostapd/hostapd.conf:

interface=wlan0
driver=nl80211
ssid=SSID
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=PW
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

In /etc/default/hostapd:

DAEMON_CONF="/etc/hostapd/hostapd.conf"

But after all nothing happens, i tried rebooting and restarting the services but nothing.. There is no SSID

Then I again started with a fresh stretch installation and did every single step like its written in the documentation, but again i had no success.

Can somebody tell me what I am doing wrong? Or how to debug? Or is there even a more simple solution for my problem?

Milliways
  • 59,890
  • 31
  • 101
  • 209
sporc
  • 161
  • 1
  • 9

2 Answers2

1

After hours of trying I successfully ended up with a working accesspoint. For every other user struggling with the same issue here is the solution:

I found a nice bash from LewisColes1986 on github, which worked right out of the box. One is for setting up the ap and the other is a fix for stretch. Many thanks!

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

I started with a fresh stretch installation and followed the instructions:

curl -sSL https://gist.github.com/Lewiscowles1986/fecd4de0b45b2029c390/raw/0c8b3af3530a35db9ab958defe9629cb5ea99972/rPi3-ap-setup.sh | sudo bash $0 password rPi3AP
sudo wget -q https://gist.githubusercontent.com/Lewiscowles1986/390d4d423a08c4663c0ada0adfe04cdb/raw/5b41bc95d1d483b48e119db64e0603eefaec57ff/dhcpcd.sh -O /usr/lib/dhcpcd5/dhcpcd
sudo chmod +x /usr/lib/dhcpcd5/dhcpcd

You can replace password with your password, rPi3AP will be the ap name, you can change that too.

After a reboot everything works!

If you want to change the name, password or any other setting you can simply change the values in /etc/hostapd/hostapd.conf

After running this script the ethernet connection does not work. To fix this just add the following to /etc/network/interfaces

auto eth0
    allow-hotplug eth0
    iface eth0 inet dhcp

Hope it helps someone!

sporc
  • 161
  • 1
  • 9
  • You use curl and a afterwards wget. I don't understand this step. Both programs can do the same. Can you explain it please? – Ingo Feb 09 '18 at 09:25
-1

My setup https://github.com/avishayp/pi-ap, tested on multiple rpi3 devices running 2018 raspbian stretch lite.

avip
  • 99
  • 2