JeyDe
Posts: 10
Joined: Thu Jun 14, 2018 9:14 am

Can't see my AP on other devices

Tue Jun 19, 2018 9:20 am

Hello everyone,

im new to this whole Rasberry Pi community and i have a problem.
As i tried to set up an Access Point on my Raspberry Pi 3B with the description given in the official documentation i got a lot of errors. As is continued searching on Google and in this Forum i found various other tutorials but neither of them worked for me (maybe my fault...)

i currently have a code where i get no errors but I cant find my AP with other devices and when i go over the network simbol in the task bar it says "wlan0 not associated". I dont have ethernet connected (nor i want to with this server).

This is my current config Setup:

/etc/dhcpcd.conf

Code: Select all

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

/etc/hostapd/hostapd.conf

Code: Select all

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

/etc/dnsmasq.conf

Code: Select all

interface=wlan0
domain-needed
bogus-priv
dhcp-range=192.168.4.2,192.168.4.25,24h
When I use "sudo service hostapd status" it displays no errors. Can you guys see a problem in my configs?

Thanks for any advice,
JeyDe

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

Re: Can't see my AP on other devices

Tue Jun 19, 2018 9:59 am

When you check the status, does it show active (running)?
If it shows active (exited), it failed to start correctly.

JeyDe
Posts: 10
Joined: Thu Jun 14, 2018 9:14 am

Re: Can't see my AP on other devices

Tue Jun 19, 2018 10:22 am

Alright thanks,
it says exited. Any idea on how to fix it?

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

Re: Can't see my AP on other devices

Tue Jun 19, 2018 12:37 pm

Ensure you have changed the "DAEMON_CONF" line in /etc/default/hostapd.
Check ifconfig to verify the correct ip was assigned (192.168.4.1). Post the output if you have questions.
Check the status of dnsmasq.

Code: Select all

sudo service dnsmasq status

JeyDe
Posts: 10
Joined: Thu Jun 14, 2018 9:14 am

Re: Can't see my AP on other devices

Tue Jun 19, 2018 1:54 pm

Alright.
Seems like my IP is not set properly

Code: Select all

wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
	inet 192.168.43.17	netmask 255.255.255.0 broadcast 192.168.43.255
	ether b8:27<.eb:2c:77:d9 txqueuelen 1000 (Ethernet)
	RX packets 79359 Bytes 110450344 (105.3 MiB)
	RX errors 0 dropped 0 overruns 0 frame 0
	RX packets 38871 Bytes 3549858 (3.3 MiB)
	RX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

	

JeyDe
Posts: 10
Joined: Thu Jun 14, 2018 9:14 am

Re: Can't see my AP on other devices

Tue Jun 19, 2018 2:11 pm

dnsmasq is active(running) but with warnings:

Code: Select all

dnsmasq[479]: Warning: interface wlan0 not exisiting
dnsmasq[479]: no Server in /run/dnsmasq/resolv.conf found
dnsmasq[481]: Too few arguments.

hostapd Status Shows

Code: Select all

hostapd.service - LSB:Advanced IEEE 802.11 management deamon
Loaded: loaded (/etc/init.d/hostapd; generated; vendor present: enabled)
Active: active(exited) since Tue....
Docs: man:systemd-sysv-generator(8)
Process: 427 ExecStart=/etc/int.d/hostapd start (code=exited, status=0/SUCCSESS)
CGroup: /System.slice/hostapd.service
i appreciate your help!
Last edited by JeyDe on Tue Jun 19, 2018 2:52 pm, edited 1 time in total.

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

Re: Can't see my AP on other devices

Tue Jun 19, 2018 2:24 pm

Open /etc/wpa_supplicant/wpa_supplicant.conf with a text editor.

Code: Select all

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
If there is a network section in that file, it will cause your hostapd service to exit rather than run.
Remove any network sections from that file and save.
Reboot.

JeyDe
Posts: 10
Joined: Thu Jun 14, 2018 9:14 am

Re: Can't see my AP on other devices

Tue Jun 19, 2018 2:43 pm

I did, still the same warning in dnsmasq and hostadp

(there was a Network part in it btw)

when i open the path /run/dnsmasq/resolv.conf it just shows

Code: Select all

# Generated by resolvconf
also when i hover over the Network Symbol it shows wlan0: Not associated
i assume there's something wrong im my dhcpcd.conf if Interface wlan0 doesnt exist right?

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

Re: Can't see my AP on other devices

Tue Jun 19, 2018 2:56 pm

Do you have an internet connection? If not, what dns server do you expect to use?

BTW, it is obvious you did not follow the online doc very closely. There are discrepancies in your file contents. This is the official doc.
https://www.raspberrypi.org/documentati ... s-point.md

JeyDe
Posts: 10
Joined: Thu Jun 14, 2018 9:14 am

Re: Can't see my AP on other devices

Wed Jun 20, 2018 7:46 am

After (again) following all steps in the official Doc i have both active (running) but i still have no visable ssid and i still have the dnsmasq warning that there is currently no interface wlan0 existing. Do you have an idea where a potential mistake might be?

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

Re: Can't see my AP on other devices

Wed Jun 20, 2018 11:07 am

Sometimes the hostapd service doesn't start right. As a test, try this from a terminal

Code: Select all

sudo service hostapd stop
wait a few seconds, then

Code: Select all

sudo service hostapd start
Do you see the ssid on you client devices after this?

My dnsmasq also warns about the interface, but it starts ok. Here is the output.

Code: Select all

Jun 19 08:48:44 raspberrypi dnsmasq[513]: warning: interface wlan0 does not currently exist
Jun 19 08:48:44 raspberrypi dnsmasq-dhcp[513]: DHCP, IP range 192.168.4.2 -- 192.168.4.20, lease time 1d
Jun 19 08:48:44 raspberrypi dnsmasq[513]: reading /run/dnsmasq/resolv.conf
Jun 19 08:48:44 raspberrypi dnsmasq[513]: using nameserver 68.105.28.17#53
Jun 19 08:48:44 raspberrypi dnsmasq[513]: using nameserver 68.105.29.17#53
Jun 19 08:48:44 raspberrypi dnsmasq[513]: read /etc/hosts - 5 addresses
Jun 19 08:48:44 raspberrypi dnsmasq[514]: Too few arguments.
Jun 19 08:48:44 raspberrypi systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
 

epoch1970
Posts: 2079
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Can't see my AP on other devices

Wed Jun 20, 2018 11:24 am

JeyDe wrote:
Tue Jun 19, 2018 9:20 am
This is my current config Setup:

/etc/dhcpcd.conf

Code: Select all

 
static Domain_name_servers=8.8.8.8
I think the config file might be case-sensitive. Try "domain_name_servers" instead.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

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

Re: Can't see my AP on other devices

Wed Jun 20, 2018 11:33 am

epoch1970 is correct. It is case sensitive, but my tests showed that it uses only the ip address. The dnsmasq service will use the domain name servers assigned to the WAN interface.

JeyDe
Posts: 10
Joined: Thu Jun 14, 2018 9:14 am

Re: Can't see my AP on other devices

Wed Jun 20, 2018 2:51 pm

Hello epoch 1970,

that thing was just a typo, it is correct in my config.

@SurferTim after stoping and starting hostadp i still cant see the AP on my smartphone. I'll check for typos in my config files and hope i find something...

Another question: during my research I found a report that said dnsmasq < v.2.77 may have a bug. I checked and when I install dnsmasq via apt-get i get v2.76. Mmay that be an issue?

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

Re: Can't see my AP on other devices

Wed Jun 20, 2018 3:13 pm

I have dnsmasq v2.76, and mine works.

Edit: If you can't connect or can't see the AP on client devices, that is hostapd.

Code: Select all

sudo service hostapd status
If you can connect but don't get network settings, then that is dnsmasq.

Code: Select all

sudo service dnsmasq status
Both should show active (running).

wolf.z
Posts: 85
Joined: Thu Dec 24, 2015 8:34 pm

Re: Can't see my AP on other devices

Thu Jun 21, 2018 11:56 am

I see 3 possible sources of error.

1. Make sure, your WIFI hardware is AP enabled. To do so
iw list | grep AP
should return something with "AP" in it. Otherwise your hardware does not support AP mode.

2. Are you sure, you need the driver statement in hostapd.conf? This line wasted 40h of my lifetime. Try without driver=nl80211, or comment out.

3. You may either let dhcpcd/wpa_supplicant OR hostapd/dnsmasq manage your WIFI hardware. Include a denyinterfaces wlan0 statement in xour dhcpcd.conf. dhcpcd is a dhcp client daemon. That does not work as an AP with a dnsmaq acting as a DHCP/DNS server. Rather configure static adress in /etc/network/interfaces and comment out line wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf in interfaces

When dhcpcd is prevented from catching your wlan0 you should be able to start hostapd and see your SSID.

Everything other than that did not work on my Pi. Further details see
https://frillip.com/using-your-raspberr ... h-hostapd/

In my setup with one wireless adapter wlan0 connecting to a router (10.0.0.x) and a second one wlan1 acting as an access point (10.0.1.x) , my interfaces file looks like

Code: Select all

auto lo
iface lo inet loopback

iface eth0 inet manual

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

allow-hotplug wlan1
iface wlan1 inet static
    address 10.0.1.5
    netmask 255.255.255.0
    network 10.0.1.0
    hostapd /etc/hostapd/hostapd.conf
my dhcpcd.conf looks like

Code: Select all

....
# server, but it should not be run by default.
nohook lookup-hostname

denyinterfaces wlan1

interface wlan0
static routers=10.0.0.1
static ip_address=10.0.0.5
static domain_name_servers=10.0.0.1
static domain_search=
I use dnsmasq and iptables successfully.

Return to “Networking and servers”