WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9738
hostapd - wifi AP daemon
« on: October 10, 2009, 12: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

  • WikiUser
  • *
  • Posts: 3
Re: hostapd - wifi AP daemon
« Reply #1 on: May 08, 2010, 02: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: 9738
Re: hostapd - wifi AP daemon
« Reply #2 on: May 08, 2010, 03: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

  • WikiUser
  • *
  • Posts: 3
Re: hostapd - wifi AP daemon
« Reply #3 on: May 08, 2010, 07: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: 9738
Re: hostapd - wifi AP daemon
« Reply #4 on: May 08, 2010, 07: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, 07:41:12 AM by curaga »
The only barriers that can stop you are the ones you create yourself.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9738
Re: hostapd - wifi AP daemon
« Reply #5 on: May 08, 2010, 08: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

  • WikiUser
  • *
  • Posts: 38
Re: hostapd - wifi AP daemon
« Reply #6 on: December 21, 2017, 01: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

  • Sr. Member
  • ****
  • Posts: 287
Re: hostapd - wifi AP daemon
« Reply #7 on: December 21, 2017, 03: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: 9738
Re: hostapd - wifi AP daemon
« Reply #8 on: December 21, 2017, 10:50:16 AM »
..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

  • WikiUser
  • *
  • Posts: 38
Re: hostapd - wifi AP daemon
« Reply #9 on: December 26, 2017, 05: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

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5663
Re: hostapd - wifi AP daemon
« Reply #10 on: December 26, 2017, 06: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

  • WikiUser
  • *
  • Posts: 38
Re: hostapd - wifi AP daemon
« Reply #11 on: December 27, 2017, 12: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:~$

Offline Rich

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

Offline polikuo

  • Sr. Member
  • ****
  • Posts: 287
Re: hostapd - wifi AP daemon
« Reply #13 on: December 27, 2017, 08: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, 09:01:31 AM by polikuo »

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5663
Re: hostapd - wifi AP daemon
« Reply #14 on: December 27, 2017, 09:39:36 AM »
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