not_the_pi_guy
Posts: 2
Joined: Mon Dec 17, 2012 10:14 am

wireless AP with hostapd and realtek chipset (works)

Mon Dec 17, 2012 11:09 am

I bought a cheap generic 'nano' wifi dongle because i wanted to use my raspberry as a hotspot. The chipset for this device is rtl8188cus

I followed the instructions i found via this board but located here http://sirlagz.net/2012/08/09/how-to-us ... er-part-1/

I ran in to trouble because the instructions call for specifying 'driver=nl80211' in the hostapd.conf file but this driver was not found on my system.. and after much googling around i came to the conclusion that if the device does not work with the nl80211 driver there is no way to use hostapd and my best course of action was to go out and buy a new dongle (preferably something made by belkin with a ralink chipset).

Not being one to give up too easily i thought i might look a little deeper, what i discovered is that its not the nl80211 a device needs to work with its the cfg80211 api, this page gives us an insight http://www.linuxwireless.org/en/develop ... n/cfg80211 i'm not going to pretend i understand the stuff about writing drivers but it did give me some hope. This page http://www.linuxwireless.org/en/users/Drivers lists wireless devices working in linux and if you look at the first column it gives you compatibility with cfg80211, as you can see nearly all of the listed realtek chipsets are listed as compatible.

I then went over to the realtek site http://www.realtek.com.tw/downloads/dow ... Down=false to see what they could provide and found they did indeed have a linux driver for my chipset, the kernel version didn't match but it seemed worth a try anyway. I got the driver and extracted, inside was a folder named wpa_supplicant_hostapd, which i thought had to be promising and so after little more drilling down and extracting compressed folders i had a folder named ~/RTL8188C_8192C_USB_linux_v3.4.4_4749.20121105/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/hostapd in this folder there was a makefile so i tried 'make' (this took ages) and 'make install' (this only seemed to copy 2 files to /usr/local/bin). I found a bunch of example .conf files in my extracted hostapd folder so to test i executed '/usr/local/bin/hostapd -dd ~/RTL8188C_8192C_USB_linux_v3.4.4_4749.20121105/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/hostapd/rtl_hostapd_2G.conf' and lo and behold it worked!!!

It is worth mentioning at this stage that before going though this journey of discovery i had tried the version of hostapd in my distros (raspbian) repository so i had an existing broken install of hostapd that would (fail to) start on boot, to get things rolling along i used apt to remove the broken install (it left the /etc/init.d/hostapd file intact) then copied the realtek version of hostapd from /usr/local/bin to /usr/sbin and my .conf file of choice to /etc/hostapd/hostapd.conf as these were the locations my startup scripts were already pointing to.

My raspberry now provides a fully functional stable access point everytime it starts :)

I write this in the hope that realtek will get some credit for taking the time to provide us with this software, my concern is that if people continue to say it doesn't work eventually it will not.

cal-tec
Posts: 1
Joined: Sun Dec 23, 2012 12:08 pm

Re: wireless AP with hostapd and realtek chipset (works)

Sun Dec 23, 2012 12:15 pm

HI,

Firstly I would like to say thank you for sharing this information as I was really struggling to get an AP working with the nano dongle I purchased. I had got as far as downloading the realtek driver but had not actually looked inside the archive (mainly due to them needing compiling).
I seem to be having issues with the access point dropping out after about 30-60 seconds and cant workout what is going on. Could you possibly share your hostapd.conf file so I can compare it to mine and see if it is something I have not setup correctly. Initially I thought it was a power issue but I tried it on my newer pi (rev 2. with the poly fuses removed) and got the same results. All I can guess is that it is a config issue.

Many Thanks

Calum

legitnick
Posts: 3
Joined: Tue Dec 25, 2012 10:47 pm

Re: wireless AP with hostapd and realtek chipset (works)

Fri Dec 28, 2012 4:43 am

Does this support use with freeradius?

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

Re: wireless AP with hostapd and realtek chipset (works)

Fri Dec 28, 2012 3:46 pm

I was also looking around for a solution to get hostapd to play nice with the EW-7811Un realtek RTL8188CUS.

The guys here embedded a solution in there image found here,

http://esrlabs.com/android-transporter- ... pberry-pi/

see my post in here

http://www.raspberrypi.org/phpBB3/viewt ... &start=100

I'm looking for more information about how they were able to compile hostapd with the rtl871xdrv driver (which presumably they wrote), maybe an alternative solution lies in your method with the realtek firmware.

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

Re: wireless AP with hostapd and realtek chipset (works)

Fri Dec 28, 2012 7:55 pm

ah ok it looks like that was what esrlabs did was rebuild hostapd using the source found in the wpa_supplicant_hostapd-0.8 folder inside the driver from realtek

User avatar
DrSnake
Posts: 6
Joined: Fri Jan 04, 2013 1:04 pm

Re: wireless AP with hostapd and realtek chipset (works)

Fri Jan 04, 2013 1:28 pm

hi not_the_pi_guy and others guys.

Well, i have a rtl8188cus too and i followed your words carefully. When i do a hostapd -dd path_to_the_conf (with the rtl_hostapd_2G.conf like you), "something" works (a quick check during the process with iwconfig says that i'm on master mode with the right essid) and i can see my network from the rpi on my devices but :
  • i can't connect the network : the process (on a Android stock 4.2.1 device) never says "connecting" or something like that, and after some try, the network disappears for a little lapse of time and comes back.
  • when i try to not only test de config (aka launch hostapd as a service after kill the config test process), i get a [FAIL] Starting advanced IEEE 802.11 management: hostapd failed! at the service launch command and at boot after add the service to boot sequence.
I followed all the tutorial you linked (copy/paste all the config). Then i followed your tips and finaly, i change the link for the config file in /etc/default/hostapd like that (after a correct cp command ...) :

Code: Select all

DAEMON_CONF="/etc/hostapd/rtl_hostapd_2G.conf"
An idea on what I did wrong ?
sorry for my bad english, i'm a lazy french man

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

Re: wireless AP with hostapd and realtek chipset (works)

Fri Jan 04, 2013 4:00 pm

Unless your trying to bridge a connection you won't be able to connect without a dhcp running. I used dnsmasq
I liked this link below, it uses a different chip, but it shows you the flow.
http://blog.bokhorst.biz/3395/computers ... ess-point/

That 2g.conf wasn't setup right for me.

Code: Select all

interface=wlan0
driver=rtl871xdrv
ctrl_interface=/var/run/hostapd
ssid=testAP
hw_mode=g
channel=1
wpa=3
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=2
ignore_broadcast_ssid=0
wpa_passphrase=testpass
macaddr_acl=0

User avatar
DrSnake
Posts: 6
Joined: Fri Jan 04, 2013 1:04 pm

Re: wireless AP with hostapd and realtek chipset (works)

Fri Jan 04, 2013 9:25 pm

Just a notice :
I want to build link between 2 devices. I don't want to bridge 2 connections. That is to say, i have no internet connection to bridge. My project needs that an Android device connect itself to the RPi without wire. I can't use a simple ad-hoc network because my (stock) Android device does not support this type of network. So, i need that my RPi (without any possibility to handle something on it in use) deploy a wifi network at boot to permit some network exchange between the 2 devices.

There is a simpler solution for my case ?

So for your question :
That is not the role of udhcpd ? Cause i add to the subject some tips from here http://elinux.org/RPI-Wireless-Hotspot and i had install udhcpd.
sorry for my bad english, i'm a lazy french man

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

Re: wireless AP with hostapd and realtek chipset (works)

Fri Jan 04, 2013 10:05 pm

Yep your on the right track, udhcpd should work and from what you describe it sounds like that is where the issues lie.
Unfortunately I'm not familiar with that dhcp.

User avatar
DrSnake
Posts: 6
Joined: Fri Jan 04, 2013 1:04 pm

Re: wireless AP with hostapd and realtek chipset (works)

Sun Jan 06, 2013 5:18 pm

Well, i tried again the same process as i said on my first post with a fresh install of raspbian, but i have the same problem than i wrote about. :cry:

I'll try again a fresh install for do the same process but with dnsmasq instead of udhcpd but i don't know if my problem comes from my config of hostapd, my config of udhcp or simply my chip (but it is the same).
sorry for my bad english, i'm a lazy french man

User avatar
DrSnake
Posts: 6
Joined: Fri Jan 04, 2013 1:04 pm

Re: wireless AP with hostapd and realtek chipset (works)

Sun Jan 06, 2013 8:56 pm

YAY !
I worked step by step and now, i have a functional hostapd service. I see a AP on debug mode (hostapd -dd path_to_the_conf) and when it launched as a service. But for now, i didn't tried to connect (lack of dhcp managment at this step).

Then :
  • install hostapd and configure until "nl80211 not found"
  • tips for driver as not_the_pi_guy said (download, make, make install and copy of binaries)
  • to have the smallest config file, i turn it to open wifi network (without security - don't forget to change the absolute path of the config file in /etc/default/hostapd)

    Code: Select all

    interface=wlan0
    ssid=My_AP
    hw_mode=g
    channel=1
    auth_algs=1
    driver=rtl871xdrv
    
  • test it with the hostapd -dd path_to_the_conf command
  • test it as a service : sudo service hostapd start and if it sucess, add it to the automatic start list
(Note : make an iso at this step xD)
sorry for my bad english, i'm a lazy french man

User avatar
DrSnake
Posts: 6
Joined: Fri Jan 04, 2013 1:04 pm

Re: wireless AP with hostapd and realtek chipset (works)

Thu Jan 10, 2013 9:58 pm

YAY ! (again)
Well, after the last message, i installed dnsmasq as you suggest, with some tips found in your link for settings and that's all !

I have now a fonctionnal RPi with a properly configured Wifi AP. I have to try on the core of my project now. Thank to all people in this topic :)
sorry for my bad english, i'm a lazy french man

spitecho
Posts: 24
Joined: Tue Jul 10, 2012 12:03 am
Location: internet

Re: wireless AP with hostapd and realtek chipset (works)

Wed Jan 30, 2013 11:08 pm

Drsnake: What wireless dongle are you using?

I have an AWLL5099 Airlink 101 Wireless N 150 Ultra Mini-USB Adapter that almost works--the AP is visible and asks for a password but nothing can connect to it. Even without a password set. I saw someone else having hostapd problems with it in the Amazon reviews, so I'm guessing it's just a borky brand. I'm curious what brand would actually allow connections to go through.

naveenk
Posts: 1
Joined: Thu Jan 31, 2013 3:52 pm

Re: wireless AP with hostapd and realtek chipset (works)

Fri Feb 08, 2013 10:43 pm

Thanks a ton not_the_pi_guy! You rocks man! It worked like a charm on my Edimax EW-7811UN.

User avatar
DrSnake
Posts: 6
Joined: Fri Jan 04, 2013 1:04 pm

Re: wireless AP with hostapd and realtek chipset (works)

Mon Feb 11, 2013 10:21 pm

Sorry spitecho, i'm late to answer you. My working dongle is a Belkin Surf USB Wireless Micro Adapter.

EDIT : Full line from lsusb : Belkin Components F7D1102 N150/Surf Micro Wireless Adapter v1000 [Realtek RTL8188CUS]
sorry for my bad english, i'm a lazy french man

ordos
Posts: 3
Joined: Wed Feb 13, 2013 6:20 pm

Re: wireless AP with hostapd and realtek chipset (works)

Fri Feb 15, 2013 10:15 am

not_the_pi_guy's solution works! I put the Realtek source files on a github repository and made installing a bit easier by modifying the Makefile. You can read how to get it working on my blog:

http://www.jenssegers.be/blog/43/Realte ... spberry-Pi

battletux
Posts: 42
Joined: Mon May 21, 2012 7:33 pm

Re: wireless AP with hostapd and realtek chipset (works)

Thu Mar 07, 2013 3:33 pm

I'm looking to use one of my pi's for a wifi access point by the TV. I'm in the process of building hostapd to support my wifi dongles RTL8188CUS chipset as set out above. However I want to keep my existing DHCP server and just pass the DHCP requests through the pi to the devices connected to it. Does anyone know of a guide that would detail this process? I'd rather not add another layer of NAT if I can help it.
http://about.me/andy_mc

Havinit
Posts: 53
Joined: Sat Feb 09, 2013 12:34 pm

Re: wireless AP with hostapd and realtek chipset (works)

Thu Mar 07, 2013 4:08 pm

battletux wrote:I'm looking to use one of my pi's for a wifi access point by the TV. I'm in the process of building hostapd to support my wifi dongles RTL8188CUS chipset as set out above. However I want to keep my existing DHCP server and just pass the DHCP requests through the pi to the devices connected to it. Does anyone know of a guide that would detail this process? I'd rather not add another layer of NAT if I can help it.
Hi battletux, it sounds like you want to use Ethernet bridging to join the wireless network to whatever network connects your Pi to the DHCP server. That way everything is effectively on the same subnet, so any device on either network can broadcast for a DHCP lease in exactly the same way. (The other option is to use NAT, but that is one-way and a lot more fiddly to set up.)

Bridging is implemented in the kernel, with userspace tools (the package is "bridge-utils" on Gentoo) to manage bridge interfaces (known as br* devices, eg br0 is an interface joining eth0 and wlan0). Operation is pretty simple, refer to the bridge-utils docs and/or those of any connection managers such as NetworkManager that you might also be using.

simonx
Posts: 1
Joined: Thu Mar 14, 2013 9:56 pm

Re: wireless AP with hostapd and realtek chipset (works)

Thu Mar 14, 2013 10:05 pm

Hi
I've tried all of I can think of, so here I am willing for some help

Got a Raspberry with F7D2102 (N300)

Code: Select all

Bus 001 Device 005: ID 050d:2103 Belkin Components F7D2102 802.11n N300 Micro Wireless Adapter v3000 [Realtek RTL8192CU]
It works charmly connecting to my AP, to an iPhone with HotSpot enabled etc etc

BUT

I can't make it work as an AP.

I configured hostapd (the modified one with Realtek drivers) on Raspbmc Image without DHCP (I just want to use static IPs) and it runs flawlessly but I simply can't connect to the net (I can see the SSID on my iPhone/PC and it reports WPA correctly)

this is my ifconfig

Code: Select all

wlan0     Link encap:Ethernet  HWaddr ec:1a:59:63:d5:6c  
          inet addr:10.10.10.100  Bcast:10.10.10.255  Mask:255.255.255.0
          inet6 addr: fe80::ee1a:59ff:fe63:d56c/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:10 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
my hostapd.conf

Code: Select all

interface=wlan0
driver=rtl871xdrv
ssid=RaspAP
hw_mode=g
channel=6
auth_algs=3
ignore_broadcast_ssid=0
macaddr_acl=0
wpa=3
wpa_passphrase=password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
my hostapd starting log

Code: Select all

pi@raspbmc:/usr/sbin$ sudo hostapd -dd /etc/hostapd/hostapd.conf 
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
drv->ifindex=3
l2_sock_recv==l2_sock_xmit=0x0x17f8638
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=12 freq=2467 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=13 freq=2472 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=36 freq=5180 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=40 freq=5200 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=44 freq=5220 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=48 freq=5240 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=52 freq=5260 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=56 freq=5280 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=60 freq=5300 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=64 freq=5320 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=100 freq=5500 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=104 freq=5520 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=108 freq=5540 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=112 freq=5560 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=116 freq=5580 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=120 freq=5600 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=124 freq=5620 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=128 freq=5640 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=132 freq=5660 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=136 freq=5680 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=140 freq=5700 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=149 freq=5745 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=153 freq=5765 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=157 freq=5785 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=161 freq=5805 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=165 freq=5825 MHz max_tx_power=0 dBm
Completing interface initialization
Mode: IEEE 802.11g  Channel: 6  Frequency: 2437 MHz
RATE[0] rate=10 flags=0x1
RATE[1] rate=20 flags=0x1
RATE[2] rate=55 flags=0x1
RATE[3] rate=110 flags=0x1
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
Flushing old station entries
Deauthenticate all stations
+rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=2
rtl871x_set_key_ops
rtl871x_set_key_ops
rtl871x_set_key_ops
rtl871x_set_key_ops
Using interface wlan0 with hwaddr ec:1a:59:63:d5:6c and ssid 'RaspAP'
Deriving WPA PSK based on passphrase
SSID - hexdump_ascii(len=6):
     52 61 73 70 41 50                                 RaspAP          
PSK (ASCII passphrase) - hexdump_ascii(len=8): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
rtl871x_set_wps_assoc_resp_ie
rtl871x_set_wps_beacon_ie
rtl871x_set_wps_probe_resp_ie
random: Got 20/20 bytes from /dev/random
Get randomness: len=32 entropy=0
GMK - hexdump(len=32): [REMOVED]
Get randomness: len=32 entropy=0
Key Counter - hexdump(len=32): [REMOVED]
WPA: group state machine entering state GTK_INIT (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=32): [REMOVED]
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
rtl871x_set_key_ops
rtl871x_set_beacon_ops
rtl871x_set_hidden_ssid_ops
wlan0: Setup of interface done.
Wireless event: cmd=0x8b15 len=20
Wireless event: cmd=0x8b15 len=20
Wireless event: cmd=0x8b19 len=8
Then it continues with wireless events but nothing triggered by my connection tries.

The only strange thing I can see it's the 0 dBm.

Tried the Belkin dongle connected directly to Raspberry or through Powered Hub.

Tell me if you need some other informations.

Any help is appreciated, willing to know where I fail


Thank you,
S

Edit: Solved, the problem was the wpa_supplicant process running... didn't find it on /etc/network/interfaces so i thought it wasn't running. Killed it, works like a charm :)

paolo
Posts: 7
Joined: Mon Apr 02, 2012 4:43 pm

Re: wireless AP with hostapd and realtek chipset (works)

Fri Mar 29, 2013 10:41 am

Hi, I am trying to follow the instructions. But I have a question: i just tried to replace the wireless-tools that come with raspbian with those from Realtek, but when i do "iwconfig wlan0 txpower 0" i still get the same error "Operation not permitted"..
I was wondering whether you have the same problem

User avatar
RichardBronosky
Posts: 82
Joined: Thu Feb 14, 2013 5:38 pm
Location: Atlanta, GA, USA

Re: wireless AP with hostapd and realtek chipset (works)

Fri Mar 29, 2013 11:17 am

paolo wrote:Hi, I am trying to follow the instructions. But I have a question: i just tried to replace the wireless-tools that come with raspbian with those from Realtek, but when i do "iwconfig wlan0 txpower 0" i still get the same error "Operation not permitted"..
I was wondering whether you have the same problem
Are you using sudo?
-- Bruno Bronosky
1x RPi 1 (B)
1x RPi 1+ (B)
2x RPi 2
11x RPi 3
4x RPi Zero W
2x RPi camera module
3x AIY Voice kits
https://github.com/RichardBronosky/pi-gen-extender
https://github.com/RichardBronosky/raspbian-boot-setup

Oldchatterman
Posts: 6
Joined: Wed Apr 03, 2013 8:33 pm

Re: wireless AP with hostapd and realtek chipset (works)

Wed Apr 10, 2013 6:17 pm

@simonx: how did you kill the wpa_supplicant process for good?

I think I have the same problem. In raspbian I am able to use my wifi dongle as AP, but when using the Raspbmc image I can't get it working. The AP is there for a few seconds and then dissappears. Ifconfig shows no wlan0 at all in that case and iwconfig shows a managed wifi dongle.

FrankLi
Posts: 8
Joined: Wed May 15, 2013 8:04 am

Re: wireless AP with hostapd and realtek chipset (works)

Thu May 16, 2013 8:12 am

I'm using EDUP EP-N8508GS wireless dongle, which use RTL8188cus chipset. I also failed to start hostapd. It showed that nl80211 interface not exist. So in hostapd.conf, what should I write after driver=?? Should I need to rebuild the driver and hostapd source code?

climbdave
Posts: 7
Joined: Thu Jun 21, 2012 2:59 pm

Re: wireless AP with hostapd and realtek chipset (works)

Thu Aug 29, 2013 9:50 am

Hi,
thanks for your suggestions. I was able to configure my cheap wifi-dongle as an AP. Yet I am still having a little issue.
hostapd and dnsmasq work together like a charm whenever I start the pi without any wired network connection. If I then add the wired network after hostapd is running, the raspi works perfectly as a NAT (I configured it to do so).

However, something weird happens if the wired connection is established before hostapd kicks in. Basically, hostapd will appear to have configured the network correctly. iwconfig and ifconfig will report correct readings, and yet neighboring devices won't detect any network.

Do you guys have any idea of how to debug this?


thanks

Davide

PS: below are my conf files as well as the outputs of iwconfig and ifconfig

cat /etc/hostapd/hostapd.conf
logger_syslog=-1
logger_syslog_level=0
logger_stdout=-1
logger_stdout_level=0
interface=wlan0
driver=rtl871xdrv
ssid=raspi
hw_mode=g
channel=7
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=....
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

-----------------

cat /etc/network/interfaces

auto lo eth0

iface lo inet loopback
iface eth0 inet dhcp

#allow-hotplug wlan0
#iface wlan0 inet manual

auto wlan0
iface wlan0 inet static
address 192.168.41.1
netmask 255.255.255.0

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

up iptables-restore < /etc/iptables.ipv4.nat


-------------------------------------------------

iwconfig
wlan0 IEEE 802.11bgn ESSID:"raspi" Nickname:"<WIFI@REALTEK>"
Mode:Master Frequency:2.437 GHz Access Point: 4C:60:DE:64:6C:5B
Bit Rate:150 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

lo no wireless extensions.

eth0 no wireless extensions.
-----------------

ifconfig


eth0 Link encap:Ethernet HWaddr b8:27:eb:e4:3f:f3
inet addr:131.254.100.61 Bcast:131.254.127.255 Mask:255.255.128.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:123039 errors:0 dropped:0 overruns:0 frame:0
TX packets:1678 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9573949 (9.1 MiB) TX bytes:292678 (285.8 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 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:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

wlan0 Link encap:Ethernet HWaddr 4c:60:de:64:6c:5b
inet addr:192.168.41.1 Bcast:192.168.41.255 Mask:255.255.255.0
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)

fireside
Posts: 6
Joined: Tue Mar 26, 2013 4:40 pm

Re: wireless AP with hostapd and realtek chipset (works)

Wed Oct 16, 2013 3:29 am

THANK YOU!!

Also, this point you made was absolutely critical to my install

"to get things rolling along i used apt to remove the broken install (it left the /etc/init.d/hostapd file intact) then copied the realtek version of hostapd from /usr/local/bin to /usr/sbin and my .conf file of choice to /etc/hostapd/hostapd.conf as these were the locations my startup scripts were already pointing to."

Return to “General discussion”