Raspberry Pi, wireless dongle, hostapd

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
geordonv
 
Posts: 18
Joined: Wed Dec 18, 2013 11:13 pm

Raspberry Pi, wireless dongle, hostapd

Post by geordonv »

Hi, folks! I just got a Pi a few days ago, with the intent of turning it into a TOR relay when all is said and done.

I've got the Pi set up and working with both eth0 and wlan0 on my "normal" network, so I know that the hardware works. I'm running the latest Raspbian but can NOT get hosted to work right. I'm following the how to over at learning.adafruit to set up a WAP, including downloading the Adafruit-compiled hostapd. This is my hostapd.conf:

Code: Select all

interface=wlan0
driver=rtl871xdrv
ssid=Pi_AP
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=Raspberry
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
Here is the output that I get when trying to start hostapd

Code: Select all

Configuration file: /etc/hostapd/hostapd.conf
drv->ifindex=3
l2_sock_recv==l2_sock_xmit=0x0x10ce638
+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 00:13:ef:d0:2a:ca and ssid 'Pi_AP'
rtl871x_set_wps_assoc_resp_ie
rtl871x_set_wps_beacon_ie
rtl871x_set_wps_probe_resp_ie
rtl871x_set_key_ops
rtl871x_set_beacon_ops
rtl871x_set_hidden_ssid_ops
ioctl[RTL_IOCTL_HOSTAPD]: Invalid argument
I'm thinking that I might need a new (compatible?) driver to go with the latest raspbian, but the instructions for THAT are out of date on the adafruit website, too. :(

Any suggestions would be VERY appreciated

geordonv
 
Posts: 18
Joined: Wed Dec 18, 2013 11:13 pm

Re: Raspberry Pi, wireless dongle, hostapd

Post by geordonv »

Upon further investigation, I think that something in the hostapd is what's messing me up. Here's my /etc/hostapd/hostapd.conf:

Code: Select all

interface=wlan0
driver=rtl871xdrv
ssid=Onion
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=raspberr
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
When I run sudo /usr/sbin/hostapd -d /etc/hostapd/hostapd.conf, this is what comes up:

Code: Select all

random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
drv->ifindex=3
l2_sock_recv==l2_sock_xmit=0x0xda5648
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
Completing interface initialization
Mode: IEEE 802.11b  Channel: 6  Frequency: 2437 MHz
RATE[0] rate=10 flags=0x1
RATE[1] rate=20 flags=0x1
RATE[2] rate=55 flags=0x0
RATE[3] rate=110 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 00:13:ef:d0:2a:ca and ssid 'Onion'
rtl871x_set_wps_assoc_resp_ie
rtl871x_set_wps_beacon_ie
rtl871x_set_wps_probe_resp_ie
rtl871x_set_beacon_ops
rtl871x_set_hidden_ssid_ops
[b]ioctl[RTL_IOCTL_HOSTAPD]: Invalid argument[/b]
wlan0: Setup of interface done.
random: Got 20/20 bytes from /dev/random
There seems to be an invalid argument somewhere, but I can not for the life of me figure out where it is.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Raspberry Pi, wireless dongle, hostapd

Post by adafruit_support_mike »

Try removing this line from the conf file:

Code: Select all

ignore_broadcast_ssid=0
That seems to be where ioctl is complaining.

geordonv
 
Posts: 18
Joined: Wed Dec 18, 2013 11:13 pm

Re: Raspberry Pi, wireless dongle, hostapd

Post by geordonv »

Edited the hostapd.conf to reflect the below:

Code: Select all

interface=wlan0
driver=rtl871xdrv
ssid=Onion
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
wpa=2
wpa_passphrase=raspberr
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
Sadly, that doesn't seem to have resolved the problem:
pi@onion-pi /var/log/privoxy $ sudo /usr/sbin/hostapd -d /etc/hostapd/hostapd.conf

Code: Select all

random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
drv->ifindex=3
l2_sock_recv==l2_sock_xmit=0x0x98a638
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
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 00:13:ef:d0:2a:ca and ssid 'Onion'
Deriving WPA PSK based on passphrase
SSID - hexdump_ascii(len=5):
     4f 6e 69 6f 6e                                    Onion
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
GMK - hexdump(len=32): [REMOVED]
Key Counter - hexdump(len=32): [REMOVED]
WPA: group state machine entering state GTK_INIT (VLAN-ID 0)
GTK - hexdump(len=16): [REMOVED]
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
rtl871x_set_key_ops
rtl871x_set_beacon_ops
rtl871x_set_hidden_ssid_ops
ioctl[RTL_IOCTL_HOSTAPD]: Invalid argument
wlan0: Setup of interface done.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Raspberry Pi, wireless dongle, hostapd

Post by adafruit_support_mike »

Hmm.. I'll have to do some more research to see what that error means.

ar_ken
 
Posts: 1
Joined: Thu Jan 02, 2014 5:50 pm

Re: Raspberry Pi, wireless dongle, hostapd

Post by ar_ken »

I'm having the very same issue.

sk00t3r
 
Posts: 2
Joined: Sat Jan 04, 2014 6:34 pm

Re: Raspberry Pi, wireless dongle, hostapd

Post by sk00t3r »

Add me to the list. Same exact issues. I can not figure this out either. Thank you.

sk00t3r
 
Posts: 2
Joined: Sat Jan 04, 2014 6:34 pm

Re: Raspberry Pi, wireless dongle, hostapd

Post by sk00t3r »

Think I got it. Download and compile the latest drivers from http://www.realtek.com.tw/downloads/dow ... Down=false Choose the RTL8188CUS.

This is what I did:

cd /tmp
sudo wget "ftp://95.130.192.218/cn/wlan/RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip" (without the quotes)
sudo unzip RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip
cd RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911
cd wpa_supplicant_hostapd
sudo tar -xvf wpa_supplicant_hostapd-0.8_rtw_r7475.20130812.tar.gz
cd wpa_supplicant_hostapd-0.8_rtw_r7475.20130812
cd hostapd
sudo make
sudo make install

sudo mv hostapd /usr/sbin/hostapd
sudo chown root.root /usr/sbin/hostapd
sudo chmod 755 /usr/sbin/hostapd

Please let me know if this workes for anyone. Thank you.
Last edited by sk00t3r on Mon Jan 06, 2014 5:50 pm, edited 3 times in total.

procrastin
 
Posts: 1
Joined: Sun Jan 05, 2014 12:37 am

Re: Raspberry Pi, wireless dongle, hostapd

Post by procrastin »

driver update instructions worked for me (except for the ftp and putting a sudo in front of the tar command)

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Raspberry Pi, wireless dongle, hostapd

Post by adafruit_support_mike »

Thanks for posting the solution. I'm still not sure why the driver would need to be updated, but I'm glad to hear that it worked.

geordonv
 
Posts: 18
Joined: Wed Dec 18, 2013 11:13 pm

Re: Raspberry Pi, wireless dongle, hostapd

Post by geordonv »

Thanks, sk00t3r, for your input about compiling and installing the hostapd fresh. That has gotten me past that particular hurdle. Now I have to figure out why I'm not getting in through the dhcpd.

Pouknouki
 
Posts: 16
Joined: Wed Nov 27, 2013 7:35 am

Re: Raspberry Pi, wireless dongle, hostapd

Post by Pouknouki »

Thanks for the solution, saved me !

scofield
 
Posts: 1
Joined: Tue Jan 21, 2014 1:50 pm

Re: Raspberry Pi, wireless dongle, hostapd

Post by scofield »

Confirmed, both the problem and the solution =)

...
Sco

User avatar
smokeandlights
 
Posts: 1
Joined: Tue Jan 28, 2014 11:28 am

Re: Raspberry Pi, wireless dongle, hostapd

Post by smokeandlights »

Same problem, Same solution! thanks!

User avatar
christiangeek
 
Posts: 6
Joined: Fri Nov 08, 2013 1:12 pm

Re: Raspberry Pi, wireless dongle, hostapd

Post by christiangeek »

Same problem here as well, the fix worked although the FTP URL shown did not work...I had to go to the Realtek site and download manually.

Thanks to sk00t3r. Adafruit...please update the tutorial to at least link to this thread. Thanks!

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”