poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Nov 22, 2012 5:36 pm

I did the complete tutorial from a fresh 2012-10-28 distro yesterday and I got an error message in the very first line when trying to install hostapd and updhcp. After i did:
"sudo apt-get update" and
"sudo apt-get upgrade"
things went well.

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Nov 22, 2012 5:58 pm

poing wrote:I did the complete tutorial from a fresh 2012-10-28 distro yesterday and I got an error message in the very first line when trying to install hostapd and updhcp. After i did:
"sudo apt-get update" and
"sudo apt-get upgrade"
things went well.
Already did that before i followed the tutorial ;)

hunternet93
Posts: 336
Joined: Mon Dec 12, 2011 4:34 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Fri Nov 23, 2012 3:20 am

Sorry I haven't responded to anyone sooner, I'll try to keep up with this thread more.
dliloch wrote:Glad to see it is working for you ..
I put the auto wlan0 in my interfaces file .. but
my installation is not consistent .. sometimes it works and
sometimes it doesn't .. by careful examination of the log
i found that for some reason when it fails I don't
get Starting DSN forwarder and DHCP server: dnsmasq message..
so I guess my question is why would this run sometimes and not others?
I am @ raspian 3.2.27 oct 18 2012 with version 346337 firmware .. should
I put on the 70 fixes??
I am trying this from a power off state .. the ethernet is NOT plugged in
I haven't seen messages like that on my Pi, are you starting from a fresh image? If you've installed other programs on your Pi, something could possibly be conflicting with the programs installed in the tutorial. Also, when it's not working, please post the output of the commands:

Code: Select all

sudo service hostapd status
ps ax | grep udhcpd
ifconfig -a
[quote="Piminiuser]I followed the instructions. But i get


[email protected] ~ $ sudo service hostapd start
[FAIL] Starting advanced IEEE 802.11 management: hostapd failed![/quote]

Try posting output of the command:

Code: Select all

sudo hostapd /etc/hostapd/hostapd.conf
This starts hostapd manually, which will hopefully give a meaningful error message.

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Fri Nov 23, 2012 9:36 am

Not having a Pi at hand right now I think it's: "sudo -d hostapd /etc/hostapd/hostapd.conf". That will give the line number having an error.

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Fri Nov 23, 2012 10:20 am

poing wrote:Not having a Pi at hand right now I think it's: "sudo -d hostapd /etc/hostapd/hostapd.conf". That will give the line number having an error.

Code: Select all

[email protected]:/home/pi# hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
nl80211: 'nl80211' generic netlink not found
Failed to initialize driver 'nl80211'
Segmentation fault
So it's the driver..

Code: Select all

lsusb
Tells me

Code: Select all

[email protected]:/home/pi# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 0bda:8171 Realtek Semiconductor Corp. RTL8188SU 802.11n WLAN Adapter


hunternet93
Posts: 336
Joined: Mon Dec 12, 2011 4:34 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Nov 25, 2012 3:30 am

Piminiuser wrote:No1 can help me? :cry:
Sorry, I haven't had time to reply yet. It looks like the driver included in Raspbian is outdated or otherwise buggy. You could try downloading and installed the drivers for your card on Ralink's website.

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Nov 25, 2012 9:02 am

hunternet93 wrote:
Piminiuser wrote:No1 can help me? :cry:
Sorry, I haven't had time to reply yet. It looks like the driver included in Raspbian is outdated or otherwise buggy. You could try downloading and installed the drivers for your card on Ralink's website.
wich driver do i need?

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Nov 25, 2012 1:20 pm

Code: Select all

Failed to initialize driver 'nl80211'

hunternet93
Posts: 336
Joined: Mon Dec 12, 2011 4:34 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Nov 25, 2012 3:15 pm

Piminiuser wrote: wich driver do i need?
Probably this one: http://www.realtek.com.tw/downloads/dow ... =true#2292. You will need to compile it, just follow the commands in the readme.

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Nov 26, 2012 11:05 am

hunternet93 wrote:
Piminiuser wrote: wich driver do i need?
Probably this one: http://www.realtek.com.tw/downloads/dow ... =true#2292. You will need to compile it, just follow the commands in the readme.
Hmz,. thats kinda hard for me. I guess it's better for me to buy another wifi dongle. they are cheap on ebay. Is there a specific dongle that i need to buy?

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Nov 26, 2012 11:23 am

I got two of these: http://www.ebay.com/itm/150-MBPS-Ralink ... 880367847?

Very cheap and works well; took a few weeks to arrive though.

User avatar
dliloch
Posts: 168
Joined: Wed Jun 27, 2012 6:28 pm
Location: cleveland, ohio usa

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Nov 26, 2012 11:27 am

I've had good luck with the tenda model w311m mini 11n wireless usb adapter. I've been able
to run it on the pi's usb port without a powered hub... it will run in AP mode but only 150mbps.
the price was $10 for me at micro center ..it's been that way for 2 months now.. must be wanting
to dump outmoded stock ..
here is the output from my iw list command:
Supported Ciphers:
* WEP40 (00-0f-ac:1)
* WEP104 (00-0f-ac:5)
* TKIP (00-0f-ac:2)
* CCMP (00-0f-ac:4)
Available Antennas: TX 0 RX 0
Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* WDS
* monitor
* mesh point
software interface modes (can always be added):
* AP/VLAN
* monitor
interface combinations are not supported
Supported commands:
* new_interface
* set_interface
* new_key
* new_beacon
* new_station
* new_mpath
* set_mesh_params
* set_bss
* authenticate
* associate
* deauthenticate
* disassociate
* join_ibss
* join_mesh
* remain_on_channel
* set_tx_bitrate_mask
* action
* frame_wait_cancel
* set_wiphy_netns
* set_channel
* set_wds_peer
* connect
* disconnect
disclaimer: still working on making my pi come up headless and being a dhcp for demo purposes.
sometimes i get 192.168.2.1 and other times no address .. have to put on a keyboard and monitor
and do a restart network command .. haven't even gotten to the access point yet..
good luck..

User avatar
truehl
Posts: 642
Joined: Sun Mar 04, 2012 6:47 pm
Contact: Website

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Nov 29, 2012 5:02 pm

What are the WiFi devices that will run?

I've successfully tested a BIGtec 150Mbit nano USB WLAN Stick Adapter.

The EDIMAX EW-7811UN Wireless USB Adapter, 150 Mbit/s, IEEE802.11b/g/n and the Netgear N150 Wireless USB Microadapter don't work.

I also saw, that you place a "driver=nl80211" in /etc/hostapd/hostapd.conf. I comment I out and it still works with the BIGtec device but not with the other ones!

Did outhers get them working?
truehl
http://www.squeezeplug.de

User avatar
dliloch
Posts: 168
Joined: Wed Jun 27, 2012 6:28 pm
Location: cleveland, ohio usa

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Nov 29, 2012 6:20 pm

I got the ap and the NAT working .. but now only my mac-mini works.. the ipad and the windows machine will connect and immediately drop .. looking at /var/log/syslog I see
hostapd disassociated then
hostapd deauthenticated due to inactivity ..
I have no security to keep things simple .. why would the mac mini running lion work and the others
fail???

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Nov 29, 2012 9:29 pm

truehl wrote:What are the WiFi devices that will run?

I've successfully tested a BIGtec 150Mbit nano USB WLAN Stick Adapter.

The EDIMAX EW-7811UN Wireless USB Adapter, 150 Mbit/s, IEEE802.11b/g/n and the Netgear N150 Wireless USB Microadapter don't work.

I also saw, that you place a "driver=nl80211" in /etc/hostapd/hostapd.conf. I comment I out and it still works with the BIGtec device but not with the other ones!

Did outhers get them working?
The placement of "driver=nl80211" in the config file in the tutorial was from my config file posted in this thread a way back that 'worked for me' and the OP copied. That said, I believe (not 'sure') this driver is the only one that works so "driver=nl80211" could be omitted one way or the other as, I believe, it is used by default and none other will work. In effect, I think you need a compatible WiFi dongle like the one I posted earlier and then everything works. My Edimax dongle (exact name posted earlier) doesn't work; I bought a Ralink one ( see posts earlier in this thread for exact name) specifically for the purpose to make this tutorial work for me.

Hope this helps ;); going bananas, even without a (mini) apple :lol:

User avatar
dliloch
Posts: 168
Joined: Wed Jun 27, 2012 6:28 pm
Location: cleveland, ohio usa

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Fri Nov 30, 2012 11:19 am

I added wpa/wpa2 security to hostapd.conf and now all is well .. but I don't understand it..

Grauhut
Posts: 28
Joined: Mon Nov 05, 2012 7:25 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Fri Nov 30, 2012 7:55 pm

Piminiuser wrote:I guess it's better for me to buy another wifi dongle. they are cheap on ebay. Is there a specific dongle that i need to buy?
If you want something powerful take this one:

Alfa Awus036neh
http://www.ebay.com/sch/i.html?_nkw=awu ... &_from=R40

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sat Dec 01, 2012 8:34 pm

Wich dongle is best to use? Do some1 have a ebay link?

or is this a good one? http://www.ebay.com/itm/150Mbps-Mini-US ... 6148996%26

it have a Chipset Ralink:RT5370..

poing wrote:I got two of these: http://www.ebay.com/itm/150-MBPS-Ralink ... 880367847?

Very cheap and works well; took a few weeks to arrive though.
This dongle works out of the box as acces point?

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sat Dec 01, 2012 11:00 pm

Worked for me with the tutorial. The one you linked to seems the same but with an external antenna so the range should be better. The one I have has a little less range then my normal access points. I can use it one floor down, but not two.

Grauhut
Posts: 28
Joined: Mon Nov 05, 2012 7:25 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Dec 02, 2012 7:31 am

Look here for a driver that supports AP mode:
http://wireless.kernel.org/en/users/Drivers

Then choose a device from here:
http://wireless.kernel.org/en/users/Devices/USB

rt2800usb devices for instance should work fine in AP mode.

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Dec 02, 2012 10:02 am

Grauhut wrote:Look here for a driver that supports AP mode:
http://wireless.kernel.org/en/users/Drivers

Then choose a device from here:
http://wireless.kernel.org/en/users/Devices/USB

rt2800usb devices for instance should work fine in AP mode.
I dont know how to use the sites you gave..

I bought this one: http://www.ebay.com/itm/150-MBPS-Ralink ... OC:NL:3160

Is cost a few bucks, so it's no disaster if it will not work. It have a Ralink RT5370 onboard, so i guess it must work out of the box :D

zorg
Posts: 2
Joined: Tue Dec 04, 2012 8:05 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Wed Dec 05, 2012 10:17 pm

Hi All,
just thought I would share my experience. I purchased an Edimax EW-7811Un. After some digging around I found a site http://forum.stmlabs.com/printthread.php?tid=3082. Its a bit cryptic but, all you need to do is download the image file form here: http://esrlabs.com/android-transporter- ... pberry-pi/ and install it, after this has been completed you need to copy the hostapd binary form here:

Code: Select all

/usr/sbin/hostapd
and the hostapd.conf.
After this is complete you can reload your own image. You must copy the new hostapd binary after you have

Code: Select all

apt-get install hostapd
otherwise it will be over written. Once this is complete change the permissions of your new binary with this:

Code: Select all

chmod 755 /usr/sbin/hostapd
and then copy the relevant information to your own hostapd.conf file i.e

Code: Select all

driver=rtl871xdrv
Please make sure you backup your Pi first or at least any important files first.

firegoldlynx
Posts: 5
Joined: Thu Dec 27, 2012 3:26 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Dec 27, 2012 3:40 pm

Ah the modified version of the hostapd binary from here works,
http://esrlabs.com/android-transporter- ... spberry-pi

Another reference here if you don't want to strip the image for the binary.
http://blog.sip2serve.com/post/38010690 ... -rtl8192cu

Anyone know how they modified hostapd with the rtl871xdrv driver. I would like to try to get this to work on a different target.

x2phantom
Posts: 6
Joined: Sun Dec 30, 2012 11:35 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Dec 30, 2012 11:44 pm

I have a problem with hostapd on my RPi...

Everything seems to be running fine except hostapd deathenticates all machines that try to connect after some seconds.
While the machines are still connected I can browse the net, so dnsmasq and NAT are working correctly.
I've got it running on my old install, but yesterday I formatted the SD-card and started all over because I messed up my filesystem.

This is what I got from syslog:

Code: Select all

Dec 31 00:34:13 raspi hostapd: wlan0: STA de:ad:00:00:c0:de IEEE 802.11: authenticated
Dec 31 00:34:13 raspi hostapd: wlan0: STA de:ad:00:00:c0:de IEEE 802.11: associated (aid 1)
Dec 31 00:34:13 raspi hostapd: wlan0: STA de:ad:00:00:c0:de RADIUS: starting accounting session 50E0CF61-00000000
Dec 31 00:34:13 raspi hostapd: wlan0: STA de:ad:00:00:c0:de WPA: pairwise key handshake completed (RSN)
Dec 31 00:34:14 raspi dnsmasq-dhcp[1963]: DHCPREQUEST(wlan0) 192.168.1.236 de:ad:00:00:c0:de 
Dec 31 00:34:14 raspi dnsmasq-dhcp[1963]: DHCPACK(wlan0) 192.168.1.236 de:ad:00:00:c0:de omega
Dec 31 00:34:24 raspi hostapd: wlan0: STA de:ad:00:00:c0:de IEEE 802.11: disassociated
Dec 31 00:34:25 raspi hostapd: wlan0: STA de:ad:00:00:c0:de IEEE 802.11: deauthenticated due to inactivity
This is my hostapd.conf:

Code: Select all

interface=wlan0
driver=nl80211
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

ssid=AirPi
hw_mode=g
channel=3
#ap_max_inactivity=300
#disassoc_low_ack=0

wpa=2
wpa_passphrase=superSecretPW
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP

auth_algs=1
wmm_enabled=1
beacon_int=100

logger_syslog=-1
logger_syslog_level=1
I already played with deauth settings in the file, but that did not change anything.
Maybe somebody can help me.

Return to “Networking and servers”