problems with hostapd/accesspoint


9 posts
by JoeSoap » Sun Nov 04, 2012 7:22 pm
using 2012-09-18-wheezy-raspbian.img

I have a pair of pis : bosspi (512MB) the AccessPoint with rt5370 ,
and rpi(256MB) with edimax dongle as the client (STA).
I have followed SirLagz's page for hostapd but am using static
IPs and also want the system on the AP to be able to talk to
the client ... I expect that if had another pi client then
the 2 clients would be able to talk to each other.

I can get them to work, but the current problem is that I cant
seem to get the AP wlan0 to come up automatically .
When the AP (bosspi) has booted , the ifconfig wlan0 shows it
with no IP address line .

I can use sudo ifup --force wlan0 ... and then get the IP address
line shown with ifconfig ... and at this point , the iwconfig wlan
shows it as Mode:Master (not Managed) .

If I then bring up the client then they connect ok and can ssh from
one to the other. (have had problem with the sequencing of the
the AP and the client , but first want to sort out this problem).

I think that what could fix it would be a ifplugd flag saying
to check the link beat immediately the daemon was forked, and
if good then bring up , and then monitor it ... altho maybe it can do
that now if only I knew the right incantation.

some files :
snippet of /etc/network/interfaces
----------------------------------
allow-hotplug wlan0

iface wlan0 inet static
address 192.168.2.129
netmask 255.255.255.0
wpa-ssid xxxxxxxxxxxxx
wpa-psk zzzzzzzzz
----------------------------------
have tried with and without 'auto wlan0' with no success.


/etc/default/ifplugd
-----------------------------------------------------
INTERFACES="eth0 wlan0"
HOTPLUG_INTERFACES="all"
ARGS="-q -f -u0 -d10 -w -I"
SUSPEND_ACTION="stop"

-----------------------------------------------------
was originally with INTERFACES="auto" but didnt make any difference

This problem is almost certainly something I have done wrong,
but I cant see it and have been working on this all week.
any ideas or suggestions ?
Posts: 18
Joined: Sun Oct 28, 2012 4:58 pm
by SirLagz » Mon Nov 05, 2012 5:23 am
JoeSoap wrote:allow-hotplug wlan0

iface wlan0 inet static
address 192.168.2.129
netmask 255.255.255.0
wpa-ssid xxxxxxxxxxxxx
wpa-psk zzzzzzzzz
----------------------------------


What happens when you do have auto wlan0 ?
Does it bring it up at all ?
any error messages during bootup ?
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Posts: 1704
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
by JoeSoap » Mon Nov 05, 2012 9:57 am
Thanks for the response SirLagz .
with no auto then get ifconfig like :
wlan0 Link encap:Ethernet HWaddr 00:0f:53:82:50:02
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

ie no IP address line .

there are lines in syslogd :
Nov 4 22:11:28 bosspi kernel: [ 36.310451] 8021q: 802.1Q VLAN Support v1.8
Nov 4 22:11:28 bosspi kernel: [ 36.619504] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
Nov 4 22:11:29 bosspi ifplugd(eth0)[1768]: Link beat detected.
Nov 4 22:11:29 bosspi ifplugd(eth0)[1768]: Executing '/etc/ifplugd/ifplugd.action eth0 up'.

which show that ifplugd on eth0 seems to work .

just fyi :
pi@bosspi:/home/pi #sudo lsmod
Module Size Used by
aes_generic 31457 2
8021q 17332 0
garp 6157 1 8021q
stp 1889 1 garp
llc 5274 2 stp,garp
... sound stripped out
arc4 1187 2
rt2800usb 13009 0
rt2800lib 47242 1 rt2800usb
crc_ccitt 1465 1 rt2800lib
rt2x00usb 11075 1 rt2800usb
rt2x00lib 41057 3 rt2x00usb,rt2800lib,rt2800usb
mac80211 236178 3 rt2x00lib,rt2x00usb,rt2800lib
cfg80211 171957 2 mac80211,rt2x00lib
pi@bosspi:/home/pi #

ps aux | grep ifp ->
1518 ? root /usr/sbin/ifplugd -i lo -q -f -u0 -d10 -w -I
1768 ? root /usr/sbin/ifplugd -i eth0 -q -f -u0 -d10 -w -I
1798 ? root /usr/sbin/ifplugd -i mon.wlan0 -q -f -u0 -d10 -w -I
1805 ? root /usr/sbin/ifplugd -i wlan0 -q -f -u0 -d10 -w -I

so have now changed the /etc/network/interfaces to have a wlan seg like

allow-hotplug wlan0

auto wlan0
iface wlan0 inet static
# iface wlan0 inet manual
address 192.168.2.129
netmask 255.255.255.0
wpa-ssid xxxxxxxxxxxxx
wpa-psk zzzzzzzzz

and a reboot with that auto wlan0 shows the same ifconfig ie

wlan0 Link encap:Ethernet HWaddr 00:0f:53:82:50:02
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Have got a friend to host the cut down syslog :

http://www.houseman.demon.co.uk/bosspisyslog

Thanks for taking the time to respond.

If there is anymore info that might help , just ask .
Posts: 18
Joined: Sun Oct 28, 2012 4:58 pm
by SirLagz » Mon Nov 05, 2012 12:55 pm
Have you tried booting it up without the ethernet cable plugged in to see what happens ?
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Posts: 1704
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
by JoeSoap » Mon Nov 05, 2012 2:07 pm
I replugged bosspi into the keyboard+mouse+monitor and unplugged the
ethernet cable . I rebooted with /etc/network/interfaces with 'auto wlan0'
in and then with it commented out . Both had same result that ifconfig wlan0
shows no IP address line. There was (of course) no link beat detected
on the eth0 as it wasnt there.

I did wonder whether the init sequence might affect it - maybe if hostapd
were started before ifplugd then would that help .
Having difficulty deciphering what does come before what and not sure
which would be best - if the hostapd were running and then the ifplugd
started ? dont know. will think about it . (I have never used debian before).

thanks for responding .
Posts: 18
Joined: Sun Oct 28, 2012 4:58 pm
by JoeSoap » Tue Nov 06, 2012 3:53 pm
I have convinced myself that the problem is one of sequencing
and that the networking can be started and the ifplugd started
afterwards . Im not totally convinced but all I wanted was
for a remote system to come up reliably ... have lost track
of what I was originally doing.

so have 'fixed' it by shifting the /etc/init.d/ifplugd script
and running that in /etc/rc.local (with start arg) .
There must be a cleaner way ... it causes an error on the console
as whatever sequences the init sequence, cant find it .
and prolly on halt as well.
If someone understands how the sequence is controlled
and what I can do to clean up this, then I would appreciate it.

fwiw, have commented out the auto for both wlan0 and eth0 .

also dont understand what gives with rsyslogd as it is started
as first thing , and then another instance is started at the end
of the boot sequence and some stuff appears on the console and some
in the /var/log/syslog ... strange .

anyway , have wasted nearly 2 weeks on this stuff and my brain has
jellified . going to do something else now .

Hope this is of use to someone else altho I doubt it .
Posts: 18
Joined: Sun Oct 28, 2012 4:58 pm
by JoeSoap » Tue Nov 06, 2012 6:31 pm
ok, I was originally trying to ensure that I could power up the AP box and
the client (STA) box in any order and found out I couldnt . And this is still
true now . I can power up the AP and then the client and they hook up
ok ie they see each other so on the client sudo iwconfig wlan0 then shows
the associated mac address of the AP , and on the AP
sudo hostapd_cli all_sta shows the client mac etc .
I can reboot the client and it all seems to happen ok (on a basis of several
reboots).

However , rebooting the AP box causes a total lack contact .

I had thought that the AP emitted a beacon and client should respond
to that. Is that what should happen, and how can I check this ie is there
a way to monitor wireless events at each end ?

Thanks for any info
Posts: 18
Joined: Sun Oct 28, 2012 4:58 pm
by Willl0u » Wed Jul 24, 2013 1:38 pm
I have the same issue here.

Here is my /etc/network/interfaces

Code: Select all
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0

iface wlan0 inet static
address 10.0.0.1
network 10.0.0.0
netmask 255.255.255.0
broadcast 10.0.0.255

#iface wlan0 inet manual
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp



But after reboot, ifconfig tell me that :

Code: Select all
wlan0     Link encap:Ethernet  HWaddr 00:c5:d1:12:00:34 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


I have to do a
Code: Select all
sudo ifconfig wlan0 10.0.0.1
to set the IP.
If someone have a solution to this...
Posts: 6
Joined: Sat May 19, 2012 10:12 pm
by Willl0u » Wed Jul 24, 2013 2:36 pm
Posts: 6
Joined: Sat May 19, 2012 10:12 pm