WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: hostapd - wifi AP daemon  (Read 25775 times)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
hostapd - wifi AP daemon
« on: October 10, 2009, 03:04:30 PM »
- My previous router was some crummy 200Mhz ARM, check out the new 12-core Istanbul one
- How's that different? Getting faster wlan?
- duh, it's the latency that counts


Quote
Title:          hostapd.tcz
Description:    Wlan AP mode daemon
Version:        0.6.9-3
Author:         Jouni Malinen
Original-site:  http://hostap.epitest.fi/hostapd
Copying-policy: GPL
Size:      172K
Extension_by:   Curaga
Comments:       Using this your comp can be a wireless access point.
      Open auth, WEP, WPA-PSK supported.
      Requires a mac80211 wireless driver (b43, ath*k, etc)
-
      Copy /usr/local/etc/hostapd.conf.sample somewhere, and
      run as:
      sudo hostapd /path/to/conf
Change-log:     
Current:        2009/10/10 Original
The only barriers that can stop you are the ones you create yourself.

Offline tcman

  • Newbie
  • *
  • Posts: 3
Re: hostapd - wifi AP daemon
« Reply #1 on: May 08, 2010, 05:49:12 AM »
Hi Curaga,

I try to enable hostapd and got an error as below (I copied config file and renamed to apd.conf). Any clue on this please help.

tc@box:/mnt/sda1/tce$ sudo hostapd apd.conf
Configuration file: apd.conf
Failed to set interface wlan0 to master mode.
nl80211 driver initialization failed.
rmdir[ctrl_interface]: No such file or directory
ELOOP: remaining socket: sock=5 eloop_data=0x8f566c8 user_data=(nil) handler=0x806d047

My machine is Acer Aspire One 110 (8GB SSD)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: hostapd - wifi AP daemon
« Reply #2 on: May 08, 2010, 06:00:39 AM »
- is your wifi interface named wlan0?
- are the drivers capable of master mode?
The only barriers that can stop you are the ones you create yourself.

Offline tcman

  • Newbie
  • *
  • Posts: 3
Re: hostapd - wifi AP daemon
« Reply #3 on: May 08, 2010, 10:29:14 AM »
Thanks for your prompt reply.
- Yes, my wireless interface is wlan0.
- Checked/found ath5k driver used (Atheros AR2425 chip).
- Try to set master mode and got error.
tc@box:~$ sudo iwconfig wlan0 mode master
Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; Invalid argument.
Any idea?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: hostapd - wifi AP daemon
« Reply #4 on: May 08, 2010, 10:39:37 AM »
That error is expected; master mode can only be set by hostapd nowadays.

See if there's more to the logs with increased verbosity (sudo hostapd -d -v /path/to/apd.conf)

edit: and of course, was the interface free? (ie. down, no udhcpc running on it etc)
« Last Edit: May 08, 2010, 10:41:12 AM by curaga »
The only barriers that can stop you are the ones you create yourself.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: hostapd - wifi AP daemon
« Reply #5 on: May 08, 2010, 11:31:56 AM »
Well, http://madwifi-project.org/wiki/UserDocs/ath5kAccessPoint claims it's only supported from .31 onwards. See if using the compat-wireless extension (wireless-2.6.29.1-tinycore_mod.tcz) instead of the normal one helps.
The only barriers that can stop you are the ones you create yourself.

Offline aris

  • Newbie
  • *
  • Posts: 49
Re: hostapd - wifi AP daemon
« Reply #6 on: December 21, 2017, 04:58:02 AM »
hi there
Im trying to setup hostpad using old mini pci, I'm on amd geode 233 with 128MB ram..alix old board
I cant find hostpad.tcz for Linux box 4.2.9-tinycore version 7.2, so I coppied the tcz for v8 and with .dep file

load it and its working manually
Code: [Select]
sudo hostapd -B /usr/local/etc/config/hostapd.conf
tc@box:~$ ps | grep hostapd
 1013 root     hostapd /usr/local/etc/config/hostapd.conf

Problem is when I want to run it automatically

Code: [Select]
tc@box:~$ cat /opt/bootlocal.sh
#!/bin/sh
 
sudo hostapd -B /usr/local/etc/config/hostapd.conf
/usr/local/etc/init.d/openssh start &

It wont autostart, dmesg show no info about hostapd
I obviously missing something...any clue ?

and I cant connect to hostapd AP yet
with open (no security) ..playing with it now..

thanks

Offline polikuo

  • Hero Member
  • *****
  • Posts: 758
Re: hostapd - wifi AP daemon
« Reply #7 on: December 21, 2017, 06:11:59 AM »
hi there
Im trying to setup hostpad using old mini pci, I'm on amd geode 233 with 128MB ram..alix old board
I cant find hostpad.tcz for Linux box 4.2.9-tinycore version 7.2, so I coppied the tcz for v8 and with .dep file

load it and its working manually
Code: [Select]
sudo hostapd -B /usr/local/etc/config/hostapd.conf
tc@box:~$ ps | grep hostapd
 1013 root     hostapd /usr/local/etc/config/hostapd.conf

Problem is when I want to run it automatically

Code: [Select]
tc@box:~$ cat /opt/bootlocal.sh
#!/bin/sh
 
sudo hostapd -B /usr/local/etc/config/hostapd.conf
/usr/local/etc/init.d/openssh start &

It wont autostart, dmesg show no info about hostapd
I obviously missing something...any clue ?

and I cant connect to hostapd AP yet
with open (no security) ..playing with it now..

thanks

/opt/bootlocal.sh is already run by root, remove the "sudo" from the file and reboot.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: hostapd - wifi AP daemon
« Reply #8 on: December 21, 2017, 01:50:16 PM »
..and if it still fails, look in its log file. You may need to enable syslog for the logs to appear.
The only barriers that can stop you are the ones you create yourself.

Offline aris

  • Newbie
  • *
  • Posts: 49
Re: hostapd - wifi AP daemon
« Reply #9 on: December 26, 2017, 08:47:29 PM »
Hi @polikuo
I used sudo because the non sudo is not starting hostapd..but sudo doesnt start it also

Here is the log...still no hostapd running

Code: [Select]
ps | grep hostapd
 1058 tc       grep hostapd

cat /var/log/messages | grep Ather
Jan  1 00:12:49 box user.info kernel: ath5k: phy0: Atheros AR2413 chip found (MAC: 0x78, PHY: 0x45)

cat /var/log/messages | grep hostapd
Jan  1 00:12:08 box authpriv.notice sudo:       tc : TTY=unknown ; PWD=/mnt/sda1/tce/optional ; USER=root ; COMMAND=/bin/mkdir -p /tmp/tcloop/hostapd
Jan  1 00:12:08 box authpriv.notice sudo:       tc : TTY=unknown ; PWD=/mnt/sda1/tce/optional ; USER=root ; COMMAND=/bin/mount hostapd.tcz /tmp/tcloop/hostapd -t squashfs -o loop,ro,bs=4096
Jan  1 00:12:08 box authpriv.notice sudo:       tc : TTY=unknown ; PWD=/mnt/sda1/tce/optional ; USER=root ; COMMAND=/bin/cp -ais /tmp/tcloop/hostapd/usr /

tc@box:~$ date
Sat Jan  1 00:14:57 UTC 2000

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: hostapd - wifi AP daemon
« Reply #10 on: December 26, 2017, 09:08:23 PM »
Hi aris
Code: [Select]
tc@box:~$ cat /opt/bootlocal.sh
#!/bin/sh
 
sudo hostapd -B /usr/local/etc/config/hostapd.conf
/usr/local/etc/init.d/openssh start &
Is that the full result of the  cat  command or are there other entries in your  bootlocal.sh  file?

Offline aris

  • Newbie
  • *
  • Posts: 49
Re: hostapd - wifi AP daemon
« Reply #11 on: December 27, 2017, 03:55:23 AM »
Hi Rich
here is full bootlocal.sh
Code: [Select]
cat /opt/bootlocal.sh
#!/bin/sh
# put other system startup commands here
 #busybox httpd
#/usr/local/httpd/sbin/httpd -p 80 -h /mnt/sda1/wwwsite
 #apache2mod
#rm -rf /usr/local/apache2/htdocs
#ln -s /opt/apache2/htdocs /usr/local/apache2/htdocs
#ln -sf /opt/apache2/httpd.conf /usr/local/apache2/conf/
#apachectl start
 #eth0 205
/opt/eth0.sh
hostapd -B /usr/local/etc/config/hostapd.conf
/usr/local/etc/init.d/openssh start &

tc@box:~$

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: hostapd - wifi AP daemon
« Reply #12 on: December 27, 2017, 09:43:11 AM »
Hi aris
Try changing:
Code: [Select]
#!/bin/shto:
Code: [Select]
!/bin/sh

Offline polikuo

  • Hero Member
  • *****
  • Posts: 758
Re: hostapd - wifi AP daemon
« Reply #13 on: December 27, 2017, 11:58:58 AM »
Hi Rich.
Hi aris
Try changing:
Code: [Select]
#!/bin/shto:
Code: [Select]
!/bin/sh
I don't think shebang works that way.

Maybe you could try it this way instead.
Code: [Select]
/usr/local/bin/hostapd -B /usr/local/etc/config/hostapd.conf 2>&1 | tee /tmp/hostapd.log
Read the log file to see what happened.
BTW, it looks like there's no such file by default. (/usr/local/etc/config/hostapd.conf)
Did you add it into your /opt/.filetool.lst and backup ?
« Last Edit: December 27, 2017, 12:01:31 PM by polikuo »

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: hostapd - wifi AP daemon
« Reply #14 on: December 27, 2017, 12:39:36 PM »
Hi polikuo
Hi Rich.
Hi aris
Try changing:
Code: [Select]
#!/bin/shto:
Code: [Select]
!/bin/sh
I don't think shebang works that way.
You are of course correct. I saw everything being commented out and my brain somehow shifted into stupid instead of drive. :o