BorisTheMidget
Posts: 6
Joined: Thu May 16, 2013 6:08 am

RasPi as a WiFi hostspot - Ralink RT5370

Thu May 16, 2013 6:30 am

hi Folks,

i am running raspbmc and wanted to setup the wireless adapter into AP mode so i can use xbmc remote via my ipad / phone. But, of course, i'm having issues :)

I am trying to follow this:
http://elinux.org/RPI-Wireless-Hotspot

which suggests that i can use this chipset:
Ralink RT5370 DOES support Access Point

Here is my lsusb output:

Code: Select all

pi@raspbmc:~$ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
After a few rat holes, i found a thread that suggested i update the ralink firware which i have done (via apt-get install firmware-ralink), i can now see the support for AP mode under iw list:

Code: Select all

pi@raspbmc:~$ iw list
Wiphy phy0
   <chopped>
 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
when i check the dongles AP mode:

Code: Select all

pi@raspbmc:~$ iwconfig
wlan0     IEEE 802.11bgn  ESSID:off/any
          Mode:Managed Access Point: Not-Associated   Tx-Power=20 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
when i try to switch the device to master mode, i get:

Code: Select all

pi@raspbmc:~$ sudo iwconfig wlan0 mode master
Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; Invalid argument.
Questions:
#1 - i'm assuming i need to be in master mode for my pi to broadcast in AP mode?
#2 - any ideas why i cant set it? googleing that error shows up piles of stuff which doesnt look like it is relevant :(
#3 - do i need to change "driver=nl80211" to anything else that might be an ralink driver? any ideas what?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: RasPi as a WiFi hostspot - Ralink RT5370

Thu May 16, 2013 7:15 am

http://sirlagz.net/2012/08/09/how-to-us ... er-part-1/ <-- that's how I got my RT5370 to act as an access point.

Also, if you actually follow the instructions on the wiki, that would help too.
You should only need to follow steps 1-3 on the wiki
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

BorisTheMidget
Posts: 6
Joined: Thu May 16, 2013 6:08 am

Re: RasPi as a WiFi hostspot - Ralink RT5370

Thu May 16, 2013 7:22 am

Hey mate, i must confess, i did read you're blog as well, thats where i started.

i read the comments, and answer #3 is just leave it as nl80211 :)

but, i couldnt get my dongle to switch out of managed mode. How did you set your usb dongle to run in master mode? or did you not bother?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: RasPi as a WiFi hostspot - Ralink RT5370

Thu May 16, 2013 7:33 am

BorisTheMidget wrote:Hey mate, i must confess, i did read you're blog as well, thats where i started.

i read the comments, and answer #3 is just leave it as nl80211 :)

but, i couldnt get my dongle to switch out of managed mode. How did you set your usb dongle to run in master mode? or did you not bother?
hostapd does it for you.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

BorisTheMidget
Posts: 6
Joined: Thu May 16, 2013 6:08 am

Re: RasPi as a WiFi hostspot - Ralink RT5370

Thu May 16, 2013 9:59 am

Hey Mate,

ok. i have no idea why its not working. I took your config file and moved a few comments around as they were causing it to puke:

Code: Select all

# First we configure the interface we'll be listening on
interface=wlan0
# The driver that is being used by the WiFi adapter, this could be different for everyone
driver=nl80211
# These 2 are just parameters so that the hostap daemon runs.
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
# Now onto the important WiFi configuration
ssid=RaspAP
# First up, the SSID or Network name. This is what other devices will see when they try to connect.
hw_mode=g
# I'm setting this to Wireless G mode. A, B, and G are available here.
channel=8
# This is setting the channel that the WiFi is on, valid channels are from 1-11, or 1-14 depending on location.
# Wifi Security Settings
# This sets the security settings to WPA2
wpa=2
# The line above sets the wpa passphrase to "raspiwlan", this is obtained via the wpa_passphrase command.
wpa_psk=928519398acf811e96f5dcac68a11d6aa876140599be3dd49612e760a2aaac0e
# However, you can also set a passphrase like the line below.
#wpa_passphrase=raspiwlan
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
# I've set these to WPA-PSK to indicate that we are using a Pre-Shared Key with CCMP encryption.
# Otherwise, hostapd also has a built in RADIUS server that we can use for authentcation
# But I'll leave that to another post.
# Other settings
beacon_int=100
#This sets how often the WiFi will send a beacon out.
auth_algs=3
wmm_enabled=1
Here are my error messages:

Code: Select all

pi@raspbmc:~$ hostapd -dd /etc/hostapd/hostapd.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
ctrl_interface_group=0
nl80211: interface wlan0 in phy phy0
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
nl80211: Using driver-based off-channel TX
nl80211: Register frame command failed (type=208): ret=-1 (Operation not permitted)
nl80211: Register frame match - hexdump(len=2): 04 0a
nl80211: Failed to register Action frame processing - ignore for now
nl80211: Add own interface ifindex 3
Could not set interface wlan0 flags: Operation not permitted
netlink: Operstate: linkmode=0, operstate=6
Could not set interface wlan0 flags: Operation not permitted
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Failed to set interface 3 to mode 2: -1 (Operation not permitted)
nl80211: Try mode change after setting interface down
Could not set interface wlan0 flags: Operation not permitted
nl80211: Failed to set interface down
Could not set interface wlan0 flags: Operation not permitted
nl80211: Failed to set interface down
Could not set interface wlan0 flags: Operation not permitted
nl80211: Failed to set interface down
Could not set interface wlan0 flags: Operation not permitted
nl80211: Failed to set interface down
Could not set interface wlan0 flags: Operation not permitted
nl80211: Failed to set interface down
Could not set interface wlan0 flags: Operation not permitted
nl80211: Failed to set interface down
Could not set interface wlan0 flags: Operation not permitted
nl80211: Failed to set interface down
Could not set interface wlan0 flags: Operation not permitted
nl80211: Failed to set interface down
Could not set interface wlan0 flags: Operation not permitted
nl80211: Failed to set interface down
Could not set interface wlan0 flags: Operation not permitted
nl80211: Failed to set interface down
nl80211: Interface mode change to 2 from 3 failed
nl80211 driver initialization failed.
rmdir[ctrl_interface]: No such file or directory

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: RasPi as a WiFi hostspot - Ralink RT5370

Thu May 16, 2013 10:06 am

if you're going to run hostapd manually, it needs to be run as root (sudo)
otherwisr run sudo /etc/init.d/hostapd start and it will start the hotspot
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

BorisTheMidget
Posts: 6
Joined: Thu May 16, 2013 6:08 am

Re: RasPi as a WiFi hostspot - Ralink RT5370

Fri May 17, 2013 10:29 pm

yep, works.. amazing what the right perms do, LOL :c)

the only thing i noticed on the raspbmc build (12.2) is that to get hostapd to run as a daemon, i had to modify /etc/init.d/hostapd and set the config files location explicitly there, or it wont start when you do service hostapd start, it just bombs out with no error to console or syslog.

Thanks for all your help mate!

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: RasPi as a WiFi hostspot - Ralink RT5370

Sat May 18, 2013 1:51 pm

No problems :)

IIRC hostapd has the configuration files setup in /etc/default/hostapd
So if you have a look in there, might save you some effort next time.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

Maco1717
Posts: 28
Joined: Mon Jun 17, 2013 3:12 pm

Re: RasPi as a WiFi hostspot - Ralink RT5370

Mon Jun 17, 2013 3:34 pm

HI im having problem with this aswell. NOT very experienced with Linux i must admit.

I bought this before know about AP mode and master modes and all that, not that i know anything now, just that the HW has to support this mode to be able to make an AP from it...

any way, after digging around it looked as i was going to be lucky cause it supported "soft mode AP" which I dont know if it the whole AP mode.

I received it plugged in to my Pi tested if i could connect to Wireless network and i could so the drivers were there.

then tried to create an AP and here were a im struggling...

following

this and this

and i get...

Code: Select all

pi@raspberrypi ~ $ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 005: ID 0a81:0205 Chesen Electronics Corp. PS/2 Keyboard+Mouse Adapter
pi@raspberrypi ~ $

Code: Select all

pi@raspberrypi ~ $ iw list
Wiphy phy0
<chopped>
        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

Code: Select all

pi@raspberrypi ~ $ sudo hostapd -dd /etc/hostapd/hostapd.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
Line 3: invalid/unknown driver 'nl80211'
Line 6: Invalid group '0 '
2 errors found in configuration file '/etc/hostapd/hostapd.conf'
pi@raspberrypi ~ $

Code: Select all

pi@raspberrypi ~ $ sudo /etc/init.d/hostapd start
[FAIL] Starting advanced IEEE 802.11 management: hostapd failed!
pi@raspberrypi ~ $
and this is what I have on my /etc/hostapd/hostapd.conf

Code: Select all

interface=wlan0
driver=nl80211

ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

ssid=RaspAP

hw_mode=g

channel=8
wpa=2 # This sets the security settings to WPA2
wpa_psk=928519398acf811e96f5dcac68a11d6aa876140599be3dd49612e760a2aaac0e

wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP

beacon_int=100
auth_algs=3
wmm_enabled=1
how could I know which driver driver to put on the hostapd.conf file?
is this the right one for this chipset?

I started doing the first link and then moved to the second so haven't completed any of the two manual completely should I try doing the second from scratch see how it goes? also let me know if there any more info i haven't put here you might need or could help troubleshoot.

Thanks and regards.

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: RasPi as a WiFi hostspot - Ralink RT5370

Tue Jun 18, 2013 1:14 am

everything looks fine to me...

I'd get rid of all the blank lines in hostapd.conf file and see how you go.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

Maco1717
Posts: 28
Joined: Mon Jun 17, 2013 3:12 pm

Re: RasPi as a WiFi hostspot - Ralink RT5370

Tue Jun 18, 2013 10:04 am

Got it working half the way there...

I choosed to start from scratch with this

tried the basic

Code: Select all

pi@raspberrypi ~ $ sudo /etc/init.d/hostapd start
pi@raspberrypi ~ $ sudo /etc/init.d/dnsmasq restart
[ ok ] Restarting DNS forwarder and DHCP server: dnsmasq.
pi@raspberrypi ~ $
as you can see the hostapd is not returning anything. which i found suspicious and same result not AP. but i thought about trying

sudo hostapd -dd /etc/hostapd/hostapd.conf

which returns

Code: Select all

pi@raspberrypi ~ $ sudo hostapd -dd /etc/hostapd/hostapd.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
ctrl_interface_group=0
nl80211: interface wlan0 in phy phy0
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
nl80211: Using driver-based off-channel TX
nl80211: Add own interface ifindex 3
nl80211: Set mode ifindex 3 iftype 3 (AP)
nl80211: Create interface iftype 6 (MONITOR)
nl80211: New interface mon.wlan0 created: ifindex=6
nl80211: Add own interface ifindex 6
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
nl80211: Regulatory information - country=00
nl80211: 2402-2472 @ 40 MHz
nl80211: 2457-2482 @ 40 MHz
nl80211: 2474-2494 @ 20 MHz
nl80211: 5170-5250 @ 40 MHz
nl80211: 5735-5835 @ 40 MHz
nl80211: 57240-63720 @ 2160 MHz
nl80211: Added 802.11b mode based on 802.11g information
Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=20 dBm
Completing interface initialization
Mode: IEEE 802.11g  Channel: 4  Frequency: 2427 MHz
nl80211: Set freq 2427 (ht_enabled=0 sec_channel_offset=0)
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
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
Using interface wlan0 with hwaddr 24:3c:20:09:33:b7 and ssid 'RaspAP'
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: Delay group state machine start until Beacon frames have been configured
VLAN: vlan_set_name_type(name_type=2)
nl80211: Set beacon (beacon_set=0)
WPA: Start group state machine to set initial keys
WPA: group state machine entering state GTK_INIT (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=16): [REMOVED]
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=3 alg=3 addr=0x88d1c key_idx=1 set_tx=1 seq_len=0 key_len=16
   broadcast key
wpa_driver_nl80211_set_operstate: operstate 0->1 (UP)
netlink: Operstate: linkmode=-1, operstate=6
wlan0: Setup of interface done.
RTM_NEWLINK: operstate=1 ifi_flags=0x1002 ()
nl80211: Ignore interface down event since interface wlan0 is up
RTM_NEWLINK: operstate=1 ifi_flags=0x1002 ()
nl80211: Ignore interface down event since interface mon.wlan0 is up
RTM_NEWLINK: operstate=1 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'mon.wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=1 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
nl80211: if_removed already cleared - ignore event
mgmt::deauth cb
RTM_NEWLINK: operstate=1 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
nl80211: if_removed already cleared - ignore event
VLAN: vlan_newlink(wlan0)
Add randomness: count=1 entropy=0
Add randomness: count=2 entropy=1
Add randomness: count=3 entropy=2
Add randomness: count=4 entropy=3
Add randomness: count=5 entropy=4
Add randomness: count=6 entropy=5
Add randomness: count=7 entropy=6
Add randomness: count=8 entropy=7
Add randomness: count=9 entropy=8
Add randomness: count=10 entropy=9
Add randomness: count=11 entropy=10
Add randomness: count=12 entropy=11
^CSignal 2 received - terminating
Flushing old station entries
Deauthenticate all stations
nl80211: Remove interface ifindex=6
netlink: Operstate: linkmode=0, operstate=6
nl80211: Set mode ifindex 3 iftype 2 (STATION)
so nice got an AP but when i terminate this command the AP disapears... what am i missing?

also the issues i was having was in the hostapd.conf but not the lines really there was a space at the end of some lines deleted thoose and "started working"...

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: RasPi as a WiFi hostspot - Ralink RT5370

Tue Jun 18, 2013 11:37 am

What's in /etc/default/hostapd ?
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

Maco1717
Posts: 28
Joined: Mon Jun 17, 2013 3:12 pm

Re: RasPi as a WiFi hostspot - Ralink RT5370

Tue Jun 18, 2013 1:50 pm

I used ur config man!

Code: Select all

pi@raspberrypi ~ $ sudo nano /etc/hostapd/hostapd.conf
  GNU nano 2.2.6         File: /etc/hostapd/hostapd.conf

interface=wlan0
driver=nl80211
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=RaspAP
hw_mode=g
channel=4
wpa=2
wpa_psk=928519398acf811e96f5dcac68a11d6aa876140599be3dd49612e760a2aaac0e
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
beacon_int=100
auth_algs=3
wmm_enabled=1

Maco1717
Posts: 28
Joined: Mon Jun 17, 2013 3:12 pm

Re: RasPi as a WiFi hostspot - Ralink RT5370

Tue Jun 18, 2013 1:52 pm

Maco1717 wrote:I used ur config man!

Code: Select all

pi@raspberrypi ~ $ sudo nano /etc/hostapd/hostapd.conf
  GNU nano 2.2.6         File: /etc/hostapd/hostapd.conf

interface=wlan0
driver=nl80211
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=RaspAP
hw_mode=g
channel=4
wpa=2
wpa_psk=928519398acf811e96f5dcac68a11d6aa876140599be3dd49612e760a2aaac0e
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
beacon_int=100
auth_algs=3
wmm_enabled=1
Woop sorry understood wronge

Code: Select all

 Defaults for hostapd initscript
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
#DAEMON_CONF="/etc/hostapd/hostapd.conf"

# Additional daemon options to be appended to hostapd command:-
#       -d   show more debug messages (-dd for even more)
#       -K   include key data in debug messages
#       -t   include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS=""

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: RasPi as a WiFi hostspot - Ralink RT5370

Wed Jun 19, 2013 8:11 am

Maco1717 wrote: Woop sorry understood wronge

Code: Select all

 Defaults for hostapd initscript
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
#DAEMON_CONF="/etc/hostapd/hostapd.conf"

# Additional daemon options to be appended to hostapd command:-
#       -d   show more debug messages (-dd for even more)
#       -K   include key data in debug messages
#       -t   include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS=""
You need to remove the # in front of this line -

Code: Select all

#DAEMON_CONF="/etc/hostapd/hostapd.conf"
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

Maco1717
Posts: 28
Joined: Mon Jun 17, 2013 3:12 pm

Re: RasPi as a WiFi hostspot - Ralink RT5370

Wed Jun 19, 2013 9:31 am

Hahahaha
That's embarassing :S

thanks a lot! it would have literally taken me ages to find that!
;)

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: RasPi as a WiFi hostspot - Ralink RT5370

Wed Jun 19, 2013 12:07 pm

No problems, it's hard spot when you've been looking at configuration files all day :D
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

frenchdude
Posts: 6
Joined: Sun Dec 08, 2013 10:11 pm

Re: RasPi as a WiFi hostspot - Ralink RT5370

Wed Dec 11, 2013 9:01 pm

I have configured my PI as a router with the same adapter, from the standard weezy image.

it didn't recognise the nl8200 driver so I had to download hosted source to recompile it with the driver.

Now it's working pretty well except that it's failing to initiate correctly at startup

sometimes it's the wlan0 that doesn't have any ip address, and sometime it's hostapd that fail to start.
Not good if I have to plug the console each time I restart

User avatar
allfox
Posts: 456
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: RasPi as a WiFi hostspot - Ralink RT5370

Thu Dec 12, 2013 8:04 am

frenchdude wrote:sometimes it's the wlan0 that doesn't have any ip address
This could be ifplugd doing something bad. Try edit /etc/default/ifplugd to:
INTERFACES="lo eth0"
HOTPLUG_INTERFACES="lo eth0"

User avatar
DougieLawson
Posts: 42639
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: RasPi as a WiFi hostspot - Ralink RT5370

Thu Dec 12, 2013 1:07 pm

allfox wrote:
frenchdude wrote:sometimes it's the wlan0 that doesn't have any ip address
This could be ifplugd doing something bad. Try edit /etc/default/ifplugd to:
INTERFACES="lo eth0"
HOTPLUG_INTERFACES="lo eth0"
Isn't it easier (and it should be the first line in the instructions) to use apt-get purge ifplugd before starting a project to turn a RPi into an access point. That piece of crap doesn't do anything useful.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

frenchdude
Posts: 6
Joined: Sun Dec 08, 2013 10:11 pm

Re: RasPi as a WiFi hostspot - Ralink RT5370

Thu Dec 12, 2013 11:24 pm

Thanks for replies, I might consider getting rid of ifplugd, but the issue has vanished now, maybe because I have commented the line "allow hotplug wlan0"

I have now slightly changed my configuration and connected the PI on my cable model using USB
it has been recognised directly and from now on my wan port is eth1 and the real ethernet port is free.

Now I'd like to use this port in the same subnet as wlan0

It looks like I need to somehow merge alan0 and eth0 into one only interface.
I have done some reading and I believe that I should use "interface bonding"
have someone done that with the pi already ?

sumanvoora
Posts: 1
Joined: Thu Feb 26, 2015 3:41 pm

Re: RasPi as a WiFi hostspot - Ralink RT5370

Fri Feb 27, 2015 8:02 am

I have COMFAST CF-WU720N wireless Network adapter and i want to turn my raspberry pi b+ as a wireless access point
i did the commands "iw list" and "lsusb"
from iw list command i got to know it has AP mode supported
from lsusb i got to know its ralink RT5370 wireless adapter,it has shown below like this

Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 005: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

i have set the hostapd.conf as mentioned in:
http://sirlagz.net/2012/08/09/how-to-us ... er-part-1/

Now when i do execute this command for driver=rtl871xdrv
it shows error as

Code: Select all

pi@raspberrypi /etc/hostapd $ sudo hostapd -dd /etc/hostapd/hostapd.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
ctrl_interface_group=0
drv->ifindex=3
l2_sock_recv==l2_sock_xmit=0x0xd92638
ioctl[SIOCSIWMODE]: Invalid argument
Could not set interface to mode(3)!
Could not set interface to master mode!
rtl871xdrv driver initialization failed.
rmdir[ctrl_interface]: No such file or directory
for driver = nl80211, error coming as

Code: Select all

pi@raspberrypi /etc/hostapd $ sudo hostapd -dd /etc/hostapd/hostapd.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
Line 3: invalid/unknown driver 'nl80211'
ctrl_interface_group=0
1 errors found in configuration file '/etc/hostapd/hostapd.conf'
i dont know what to do now !!!!
i think problem with that driver what to give in hostapd.conf file
for comfast cf-wu720n rtl8188eus chipset
please help me to sort these problems ASAP
Thanks in Advance :D

udbhav99
Posts: 2
Joined: Sun Oct 02, 2016 7:41 am

Re: RasPi as a WiFi hostspot - Ralink RT5370

Sun Oct 02, 2016 7:52 am

I am using a Ralink RT5370 wireless adapter and my hostapd version is 2.3.
I get the following errors, any idea how to fix them?

Code: Select all

pi@raspberrypi:~ $ sudo hostapd -dd /etc/hostapd/hostapd.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
ctrl_interface_group=0
rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:10
nl80211: Supported cipher 00-0f-ac:8
nl80211: Supported cipher 00-0f-ac:9
nl80211: Using driver-based off-channel TX
nl80211: interface wlan0 in phy phy1
nl80211: Set mode ifindex 4 iftype 3 (AP)
nl80211: Setup AP(wlan0) - device_ap_sme=0 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0x55b167f8
nl80211: Register frame type=0xb0 (WLAN_FC_STYPE_AUTH) nl_handle=0x55b167f8 match=
nl80211: Register frame command failed (type=176): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=0): [NULL]
nl80211: Could not configure driver mode
nl80211: Remove monitor interface: refcount=0
nl80211: Remove beacon (ifindex=4)
netlink: Operstate: ifindex=4 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
nl80211 driver initialization failed.
hostapd_interface_deinit_free(0x55b139f0)
hostapd_interface_deinit_free: num_bss=1 conf->num_bss=1
hostapd_interface_deinit(0x55b139f0)
hostapd_bss_deinit: deinit bss wlan0
hostapd_cleanup(hapd=0x55b15d48 (wlan0))
hostapd_free_hapd_data: Interface wlan0 wasn't started
hostapd_interface_deinit_free: driver=(nil) drv_priv=(nil) -> hapd_deinit
hostapd_interface_free(0x55b139f0)
hostapd_interface_free: free hapd 0x55b15d48
hostapd_cleanup_iface(0x55b139f0)
hostapd_cleanup_iface_partial(0x55b139f0)
hostapd_cleanup_iface: free iface=0x55b139f0

Return to “General discussion”