WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: WiFi stack added  (Read 127464 times)

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: WiFi stack added
« Reply #45 on: February 11, 2013, 02:48:08 PM »
I have looked but this is the content:

Code: [Select]
cat /etc/wpa_supplicant.conf
# reading passphrase from stdin
network={
        ssid="linksys"
        #psk="smiley12"
        psk=7b6cc12d581431c567a5dec33ca4c6e6fc85fb9e86fd0197774910932b0e9365
}

Steen

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: WiFi stack added
« Reply #46 on: February 11, 2013, 04:24:23 PM »
This config sets the minimum options to get connected. There are much more options to customize connection. read man page:

http://linux.die.net/man/5/wpa_supplicant.conf
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Gerrelt

  • Full Member
  • ***
  • Posts: 182
Re: WiFi stack added
« Reply #47 on: February 12, 2013, 01:26:10 PM »
It may happen that 150MBit/s is too high bitrate for the Pi and  it can't handle. Switch back to 54 Mbit/s and check.

I tried this, I connected it to another old wifi router I had that's 54 Mbit/s. But it didn't matter still lots of dropped packets. It was a good idea though.

I've got exactly the same experience as sbp. Maybe the dropped packets are not an actual problem. It might be just a weird way this dongle reports dropped packets.

I am going to try switching to WPA too.



my Raspberry Pi page: http://raspberry.gerrelt.nl

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: WiFi stack added
« Reply #48 on: February 12, 2013, 01:59:45 PM »
I've checked the wifi channel, it's on a unique channel, not used by anybody else in the range.
That doesn't mean much as channels may be overlapping, monitoring all traffic on a specific channel would mean more.
Quote
My dongle is 150 Mb/s, and my wifi router is 300 Mb/s. I could try setting the router to 150 Mb/s, to see if it makes any difference.
Changing max. speed of router doesn't seem to make much sense.
You can check for supported speeds with
Code: [Select]
iwlist s
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: WiFi stack added
« Reply #49 on: February 12, 2013, 02:04:17 PM »
With a lot of dropped packets, in order to troubleshoot I would try
Code: [Select]
iwconfig <interface> rate 1M fixed
It might be useful to know if the dropped packets originate mainly from tcp or udp traffic.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: WiFi stack added
« Reply #50 on: February 12, 2013, 02:06:20 PM »
Referring to report saying WPA works fine while WPA2 isn't, just an idea below without tests, measurements.

Possibly the problem is WPA2 which requires more computation than WPA. There are certain instructions are missing in the Pi's ARMv6 CPU for example hw division so there are functions which are supprisingly slow. I have an interesting bencmark with different languages as C, Java, Perl, Python, LUA, LuaJIT, etc. Will submit later. C is slower than expected due to division and Lua is better. Investigating code found that Lua is using the hw floating point for integer arithmetics to gain speed while GCC is generating a conventional code.
« Last Edit: February 12, 2013, 02:08:05 PM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: WiFi stack added
« Reply #51 on: February 13, 2013, 11:14:14 AM »
Hi thanks for all your help, but I still have some questions:

1.
Where is the password for the wifi network stored ?
Because I have changed the password on my router, and now when microcore is scanning the network, it finds the router, but delivers the old password, and therefore connection is refused.

Also it continues to connect to a network it once was connected to, but now I don't wan't it to connect to that any more. But still it automatically connect

2.
I have tried to add
Code: [Select]
key_mgmt=WPA-PSK
group=CCMP TKIP
to the /etc/wpa_supplicant.conf  file in order to force it to use WPA instead of WPA2, but the /etc/wpa_supplicant.conf
file is overwritten with a new one after a reboot (even though I added etc/wpa_supplicant.conf to the filetool.lst file before a backup)

3.
I have tried to force the wlan card to use a lower speed by:
Code: [Select]
sudo iwconfig wlan0 rate 5Mthis command terminates without error, but the iwconfig still shows a bit rate of 150 Mb/s



The audio problem for me is a combination of speed and WPA2 protection:
If I use my D-link Router N-speed (where the USB Wifi is connected by 150 Mb/s), then the sound is breaking up:
without protection
with WPA
With WPA2

If I connect to my Linksys at 54 Mb/s, the sound is fine:
without protection
with WPA

But the sound is breaking with
WPA2


So if only I could force the wifi card to use 54Mb/s and WPA while connected to my D-link, everything would be fine.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: WiFi stack added
« Reply #52 on: February 13, 2013, 11:34:20 AM »
If you are using wifi.sh then it is wifi.db in your home directory.
10+ Years Contributing to Linux Open Source Projects.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: WiFi stack added
« Reply #53 on: February 13, 2013, 02:25:13 PM »
Hi sbp
Quote
I have tried to force the wlan card to use a lower speed by:
Quote
Code: [Select]
sudo iwconfig wlan0 rate 5M
this command terminates without error, but the iwconfig still shows a bit rate of 150 Mb/s
How about if you use:
Code: [Select]
sudo iwconfig wlan0 rate 5M fixed

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: WiFi stack added
« Reply #54 on: February 13, 2013, 03:37:10 PM »
5M does not sound like a valid bitrate.
Check your radio with
Code: [Select]
iwlist band your AP with
Code: [Select]
iwlist s
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: WiFi stack added
« Reply #55 on: February 14, 2013, 02:59:55 AM »
5M does not sound like a valid bitrate.
Check your radio with
Code: [Select]
iwlist band your AP with
Code: [Select]
iwlist s

Hi, this is the result of iwlist b:

Code: [Select]
tc@box:~$ iwlist b
lo        no bit-rate information.

wlan0     4 available bit-rates :
          1 Mb/s
          2 Mb/s
          5.5 Mb/s
          11 Mb/s
          Current Bit Rate:150 Mb/s

eth0      no bit-rate information.

and here is the output from iwlist s:

Code: [Select]
Cell 03 - Address: 00:24:01:79:93:33
                    ESSID:"Steens 2.4GHz"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.442 GHz (Channel 7)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1a0050f20101000050f20202000050f2020050f20401000050f202
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD180050F204104A00011010440001021057000120103C000102
                    Quality=42/100  Signal level=43/100

If I try to manually set the speed by:
Code: [Select]
tc@box:~$ sudo iwconfig wlan0 rate 5.5M fixedIt terminates without problem, but it is still connected at 150Mb/s

So two questions remains:
1. How do I force the card to connect at a lower speed?
2. How do I force it to connect using WPA and not WPA2?
« Last Edit: February 14, 2013, 03:02:08 AM by sbp »

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: WiFi stack added
« Reply #56 on: February 14, 2013, 03:24:31 AM »

So two questions remains:
1. How do I force the card to connect at a lower speed?
2. How do I force it to connect using WPA and not WPA2?

« Last Edit: February 14, 2013, 03:26:30 AM by curaga »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: WiFi stack added
« Reply #57 on: February 14, 2013, 03:49:30 AM »
For WPA, see config example:

http://www.thinkwiki.org/wiki/How_to_install_wpa_supplicant

Did not test, not sure it works for this purpuse.
« Last Edit: February 14, 2013, 03:54:17 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: WiFi stack added
« Reply #58 on: February 14, 2013, 06:27:03 AM »
Hi, this is the result of iwlist b:

Code: [Select]
tc@box:~$ iwlist b
lo        no bit-rate information.

wlan0     4 available bit-rates :
          1 Mb/s
          2 Mb/s
          5.5 Mb/s
          11 Mb/s
          Current Bit Rate:150 Mb/s

eth0      no bit-rate information.
Hrm, it appears to show b rates only as available, and an n rate as current...   ::)

Quote
and here is the output from iwlist s:

Code: [Select]
Cell 03 - Address: 00:24:01:79:93:33
                    ESSID:"Steens 2.4GHz"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.442 GHz (Channel 7)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1a0050f20101000050f20202000050f2020050f20401000050f202
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD180050F204104A00011010440001021057000120103C000102
                    Quality=42/100  Signal level=43/100
I've never before seen an AP showing only one single bitrate, but then... A: I've never seen a n router at all and B: output of iwlist may differ between drivers.
Note that your AP seems to broadcast at 144Mb/s while your client radio appears to be set to 150Mb/s.
Channel 7 might potentially be more vulnerable to interference, you could try 1, 6, 11+

Quote
If I try to manually set the speed by:
Code: [Select]
tc@box:~$ sudo iwconfig wlan0 rate 5.5M fixedIt terminates without problem, but it is still connected at 150Mb/s

So two questions remains:
1. How do I force the card to connect at a lower speed?
This may again be driver dependent (which driver is it?)...

Try following sequence:
Code: [Select]
sudo ifconfig wlan0 down
sudo iwconfig wlan0 essid "my essid" rate 1M fixed"
sudo iwconfig wlan0 commit
sudo ifconfig wlan0 up
sudo iwconfig wlan0 essid "my essid" rate 1M fixed"
sudo iwconfig wlan0 commit

Also, best to boot with code "syslog" (though you could always run 'syslogd' manually') and in an aterm do:
Code: [Select]
tail -f /var/log/messagesso with whatever you doif you are lucky you might get some real time feedback hopefully giving some hints   ;)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Gerrelt

  • Full Member
  • ***
  • Posts: 182
Re: WiFi stack added
« Reply #59 on: February 16, 2013, 07:24:39 AM »
I've noticed my wifi problem dissapear when I boot the raspberry with an ethernet cable attached. Then, on my router's maintanance webpage, I can see two IP adresses assigned to the raspberry. When I ssh into the raspberry using the Wifi IP address (identified by the Mac address), everything works perfectly.
But, am I then really connecting through wifi? Or am I routed through he wired ethernet connection?
my Raspberry Pi page: http://raspberry.gerrelt.nl