Forum
Recommend a wifi dongle for access point setup - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Hardware (/forum-7.html)
+--- Forum: Network (/forum-25.html)
+--- Thread: Recommend a wifi dongle for access point setup (/thread-966.html)

Pages: 1 2 3 4


RE: Recommend a wifi dongle for access point setup - mk01 - 16th Nov, 2013 12:46 AM

@Wrechid

the setting you quoted is relevant only for creating ad-hoc network. for this to work you even don't need to install hostapd (and is also AP feature is not needed). so once you enter this into interfaces (assuming your wifi is on the list of "ifconfig" as wlan0), you just restart the interface (ifdown wlan0; ifup wlan0) - also assuming it is not in collision with your eth0 network while testing (if you have ethernet connected).

as soon as you restart the interface you should see wifi MYCARXBIAN in the list of available network from other devices.


RE: Recommend a wifi dongle for access point setup - Wrechid - 16th Nov, 2013 09:26 AM

ok, i'm trying to figure this out as hard as i can... this is what i have in /etc/network/interfaces, on a clean install of XBian with the lines you mentioned already added...
(16th Nov, 2013 12:46 AM)mk01 Wrote:  auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
wireless-power off
iface default inet dhcp

auto wlan0
iface wlan0 inet static
address 192.168.1.1
netmask 255.255.255.0
wireless-channel 1
wireless-essid MYCARXBIAN
wireless-mode ad-hoc

heres "ifconfig",
(16th Nov, 2013 12:46 AM)mk01 Wrote:  eth0 Link encap:Ethernet HWaddr b8:27:eb:2b:1d:19
inet addr:192.168.2.215 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2305 errors:0 dropped:0 overruns:0 frame:0
TX packets:1174 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2337544 (2.2 MiB) TX bytes:130884 (127.8 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 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 80:1f:02:34:30:f5
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST 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)

and when i restart the interface i get this,
(16th Nov, 2013 12:46 AM)mk01 Wrote:  root@xbian:~# ifdown wlan0
root@xbian:~# ifup wlan0
Error for wireless request "Set Power Management" (8B2C) :
SET failed on device wlan0 ; Operation not permitted.
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
wpa_supplicant: wpa_action is managing ifup/ifdown state of wlan0
wpa_supplicant: execute `ifdown --force wlan0' to stop wpa_action
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
run-parts: /etc/network/if-up.d/wpasupplicant exited with return code 1

this is the first error i've seen...

i'm using the Edimax EW-7811Un dongle... i'm gonna dig out my other dongles and try some trial and error...

ok, i've tried 3 other dongles... only one of them would initialize but would not allow me to connect to my router... it is a Belkin F9L1001v1, but still can't broadcast the ssid for the ad-hoc settings... :/

when i do a "ifdown wlan0; ifup wlan0" on the belkin dongle, i don't get any errors... i never had any luck with the belkin dongle on RBMC...


RE: Recommend a wifi dongle for access point setup - Wrechid - 16th Nov, 2013 10:53 AM

well... i found the problem... its not the ad-hoc settings... they are working good... the problem is that android does not support ad-hoc, so the network will not show up in the settings on android... i had a thought and plugged the belkin dongle in my desktop pc and it seen the MYCARXBIAN network right away... so your settings for ad-hoc is working well... sorry to put you through all that...

now i need to find a way to get infrastructure or access point mode to work in XBian... :/


RE: Recommend a wifi dongle for access point setup - mk01 - 16th Nov, 2013 10:56 AM

@Wrechid

oh, maybe I wasn't clear enough how to edit the interfaces file. you can't just add it to the config file, you have to replace current wlan0 relevant lines (and also encryption settings). so you interfaces should look like:

Code:
auto lo

iface lo inet loopback
iface eth0 inet dhcp

iface default inet dhcp

auto wlan0
iface wlan0 inet static
address 192.168.1.1
netmask 255.255.255.0
wireless-channel 1
wireless-essid MYCARXBIAN
wireless-mode ad-hoc

I don't know about android, can't test.

But if you have root access, you should be able to configure it manually maybe. Can't help there.

And I would be happy to help with the AP mode, but I'm not sure if I have dongle with AP support.

Where can I get this info? I have dongles with chipsets:

rt: 2570, rf: 0005, rev: 0005
zd1211rw
RT chipset 5390, rev 0502 detected (RF chipset 5370 detected)


RE: Recommend a wifi dongle for access point setup - Wrechid - 16th Nov, 2013 01:33 PM

I really appreciate your interest... As for checking the dongle for AP, I used "iw utility" on RBMC... On Xbian it didn't seem to work, as if iw utility is not installed... The command would be "iw list"... Do a search for iw utility for more info...
I have a feeling that this how-to is a good place to start, http://raspberry-at-home.com/hotspot-wifi-access-point/
There's a simple script at the end of how-to that I been trying... Tomorrow I will try do the how-to without the script and see if a error comes up as I go... When I use the script, it appears to have completed, but when I reboot Xbian, it doesn't boot... Just leaves me at a black screen...


RE: Recommend a wifi dongle for access point setup - mk01 - 16th Nov, 2013 01:45 PM

@Wrechid

I never realized that iw is checking this ability and informing about it. will check.

ok, of course it is listing that… just I never focused on that lines. if I get this output, should it be ok?

Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* WDS
* monitor
* mesh point


RE: Recommend a wifi dongle for access point setup - Wrechid - 16th Nov, 2013 01:55 PM

Doing research, they say we would need master mode or ap mode in the dongle to make this work...

As for getting ad-hoc to work on android, I do have root privilege and have tried a couple different methods... Seems that I would have to use a custom rom with ad-hoc enabled in the kernel... As my current rom doesn't have it... :/

(16th Nov, 2013 01:45 PM)mk01 Wrote:  @Wrechid

I never realized that iw is checking this ability and informing about it. will check.

ok, of course it is listing that… just I never focused on that lines. if I get this output, should it be ok?

Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* WDS
* monitor
* mesh point

Yup, it supports AP mode...


RE: Recommend a wifi dongle for access point setup - Wrechid - 16th Nov, 2013 03:34 PM

Jacek, at that how-to link wrote me back and said:
Quote:Hi,
I would check /etc/network/interface if there are any diplicated entries. Our script is NOT the state of the art. It can do some misconfiguration if assumptions that we've made, are not true in particular version of the linux distribution. I would advice you to go through our tutorial and verify all the steps if they are not corrupting your default setup on Xbian.


but would need to check the interfaces file before you reboot, since it wouldn't reboot for me... I'll look at it when I get home...

Could errors in the interfaces file cause it to not boot...?


RE: Recommend a wifi dongle for access point setup - mk01 - 16th Nov, 2013 03:39 PM

NO

definitely not "black screen".

@Wrechid

ok, I tried and succeeded (with the script). changes I needed to do manually:
1) edit /etc/network/interfaces to look like this:
Code:
auto eth0 lo

iface lo inet loopback
iface eth0 inet dhcp

iface default inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
        address 192.168.10.1
        netmask 255.255.255.0
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
up iptables-restore < /etc/iptables.ipv4.nat

then without reboot I executed those commands:
Code:
ifdown wlan0; ifup wlan0
sysctl -p /etc/sysctl.conf
service hostapd start
service isc-dhcp-server start

and I connected to AP and was able to browse internet

btw: I'm not sure if Beta1 or 1.1 had NAT support in kernel, …

after you starts the wlan0 with new config, you can check with:
Code:
iptables -L -n -t nat

and you should get this output

Code:
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination        

Chain INPUT (policy ACCEPT)
target     prot opt source               destination        

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination        

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination        
MASQUERADE  all  --  0.0.0.0/0            0.0.0.0/0



RE: Recommend a wifi dongle for access point setup - Wrechid - 16th Nov, 2013 04:21 PM

NICE...! Now I can't wait to get home and try it out... I can't thank you enough...
I think it would be really Kool to see Xbian or any XBMC distro with the AP option somehow implement into the build, and edit it's settings from within XBMC... Smile

Oh, and it's good info, to know that errors in the interface file doesn't cause boot problems...

Thanx again...

I'm not for sure which one I have, just downloaded it 5 or 6 days ago from the main site...


RE: Recommend a wifi dongle for access point setup - mk01 - 16th Nov, 2013 05:56 PM

@Wrechid

no boot problems, but still parsing of it is not ideal, because in case of any line being wrong, WHOLE interfaces file is not loaded thus no network at all (you can have just error with wlan0 configuration, but even your eth0 wont get loaded).

that's why I sent you the steps how to re-start the setup without restart. as this will not make your eth0 inaccessible. but reboot would make your RPI inaccessible from net.


RE: Recommend a wifi dongle for access point setup - Wrechid - 16th Nov, 2013 08:51 PM

Yea, I have had that issue a few times with the interfaces file... Hehe... Had to re install Xbian a few times now, just to gain network access again... The reloading method is a great help in that case... You've been a big help, I've learned a lot about Linux and networking lately... Smile


RE: Recommend a wifi dongle for access point setup - Wrechid - 17th Nov, 2013 07:08 AM

hey mk01... Smile

i've gotten much further now... i had to change the channel to 6 in /etc/hostapd/hostapd.conf due to authentication errors... i have 2 other devices here that was causing interference... the other problem i'm have is i can't start the "ISC DHCP server"... i get this error,
[FAIL] Starting ISC DHCP server: dhcpd[....] check syslog for diagnostics. ... failed! failed!
even after a reboot... i checked the /var/log/syslog and theres nothing in there except logs from Sept 6... is there another syslog file...?
its not to important since i can set phone to static and it does work... but i like a challenge... Smile
seeing the changes you made in the interface file does make a lot of sense... also the beta 1.1 is the one i have and it does have NAT support in the kernel...

i had the right syslog file, just needed to refresh WinSCP... :/
this is the error
Quote:Nov 16 21:20:13 xbian wpa_supplicant[2576]: nl80211: 'nl80211' generic netlink not found
Nov 16 21:20:13 xbian wpa_supplicant[2576]: Failed to initialize driver 'nl80211'
Nov 16 21:20:13 xbian wpa_supplicant[2576]: rfkill: Cannot open RFKILL control device
Nov 16 21:20:23 xbian dhcpd: Wrote 0 leases to leases file.
Nov 16 21:20:23 xbian dhcpd:
Nov 16 21:20:23 xbian dhcpd: No subnet declaration for wlan0 (no IPv4 addresses).
Nov 16 21:20:23 xbian dhcpd: ** Ignoring requests on wlan0. If this is not what
Nov 16 21:20:23 xbian dhcpd: you want, please write a subnet declaration
Nov 16 21:20:23 xbian dhcpd: in your dhcpd.conf file for the network segment
Nov 16 21:20:23 xbian dhcpd: to which interface wlan0 is attached. **
Nov 16 21:20:23 xbian dhcpd:
Nov 16 21:20:23 xbian dhcpd:
Nov 16 21:20:23 xbian dhcpd: Not configured to listen on any interfaces!

i think it goes back to the /etc/dhcp/dhcpd.conf file...
this is what i have in mt dhcpd.conf file,
Quote:ddns-update-style none;
default-lease-time 86400;
max-lease-time 86400;
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.2 192.168.10.9 ;
option domain-name-servers 8.8.8.8, 8.8.4.4 ;
option domain-name "home";
option routers 192.168.10.1 ;
}



RE: Recommend a wifi dongle for access point setup - mk01 - 17th Nov, 2013 08:09 AM

this looks like the interface is not up.

what you get on "ifconfig"? is wlan0 listed? do you have correct firmware file loaded?


RE: Recommend a wifi dongle for access point setup - Wrechid - 17th Nov, 2013 08:34 AM

heres my current ifconfig:
Quote:eth0 Link encap:Ethernet HWaddr b8:27:eb:2b:1d:19
inet addr:192.168.2.215 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:150 errors:0 dropped:0 overruns:0 frame:0
TX packets:133 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:15321 (14.9 KiB) TX bytes:18238 (17.8 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1104 (1.0 KiB) TX bytes:1104 (1.0 KiB)

wlan0 Link encap:Ethernet HWaddr 80:1f:02:34:30:f5
UP BROADCAST 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)

i'm not sure about the firmware, can you point me in that direction...?

ok, just looked into firmware updating, and no... i've never updated the firmware... i've seen it mentioned in many different cases but firmware on different devices can be risky, so i avoided it till it restricted me from my projects... looking into updating the firmware there seems to be many different methods... which way do you recommend...?