5

I am connected to my dedicated wireless N network at 95% signal on my Pi. On my other computers I can get a nice steady 40~50 mbps (~5 mb/s) copying from my Ubuntu NAS.

I am trying to stream video to a server that does motion detection,etc. The problem is that using custom mjpg on wireless gives me 0.7FPS - Wired is 7FPS(Which is good) and using RTSP on Wifi just buffers the whole time and is unwatchable while on LAN its 25FPS no probs!

enter image description here

My router reports a hand shaked conenction speed of 39mbps

enter image description here

I run iperf server on my Ubuntu NAS box that is wired directly to the WiFi router and then do a test from the Pi.

enter image description here

It is one of those mini dongles and its plugged directly into the Pi's USB port. I have the Pi powered by GPIO 2A and I removed the USB fuses. The USB are powered directly by the 5V rail from the GPIO pins so it can't be power problem. This dongle does work in Winblows very well even at 30%

enter image description here

Is this a driver issue?

-netcat results for Arne (I did not do 100mb because it went over a 10 minutes - I reduced it to 10mb)

root@nas:~# time head -c 10000000 /dev/zero | nc raspberrypi 8888

real    3m20.426s
user    0m0.000s
sys     0m0.072s
root@nas:~# time head -c 10000000 /dev/zero | nc raspberrypi 8888

real    3m23.162s
user    0m0.000s
sys     0m0.068s
root@nas:~#
Piotr Kula
  • 17,307
  • 6
  • 65
  • 104
  • Have you tried measuring the raw transmission speed? E.g. with netcat? Start nc on the pi: nc -l 8888. Then run nc on another computer: time head -c 100000000 /dev/zero | nc raspberrypi.local 8888. Then divide 100MB by the seconds output by time, and give us the result. – Arne Nov 14 '13 at 13:56
  • Also: repeat this experiment a couple of times, for more significant results – Arne Nov 14 '13 at 13:56
  • Also: signal level of 53 is not that good. 72 MBits sounds quite ok. However, my rtl8188 usually gets 150 MBits – Arne Nov 14 '13 at 13:56
  • Well we cannot be 100% sure if those figures reported there are correct. The firmware might be faked (this is unbranded one) and it could just show duff results. Any way signal level can be low but if quality is 100% it means there should be no lost packets at the link speed which is 70mbps (but this could also be duff). @Arne the results are about 10MB / 3.33 = 3.003 (once it went really quick though? ) 100mb wst aking long – Piotr Kula Nov 14 '13 at 14:12
  • 3m20s for 10 megabytes. That works out 50kb/s (0.4Mbps) ? Not very good ... how does nc work. It sends data to Pi and verifies the packet? Or to the Pi and back? – Piotr Kula Nov 14 '13 at 14:44
  • nc simply uses TCP/IP for sending. So yeah, the kernel verifies and retransmits packets, just like it would with HTTP over TCP/IP. But you don't have any overhead from additional protocols. It is just cat over the net. ;) And 50kB/s is really, really slow. What does dmesg or tail -F /var/log/messages say? Any error messages? – Arne Nov 14 '13 at 15:01
  • I have an RTL8188CUS, it's okay. I use the 8192cu module with it though, I have seen confusion about this before. – goldilocks Nov 14 '13 at 15:12
  • goldilocks how did you change or check which module it is using? Arne - nothing peculiar in the logs at all. – Piotr Kula Nov 14 '13 at 15:17
  • That's what's used by default, or should be. You can check with lsmod, or lsmod | grep 8192, while it is plugged in. – goldilocks Nov 14 '13 at 15:34
  • Yea that is what is showing up on lsmod. Really strange ? And It does not matter if I put the Pi on top of the router or away 5 metres. Its the same. – Piotr Kula Nov 14 '13 at 15:42
  • I plugged in an older rtl8187 54mbits... even worse 72.4Kbits - not even a megabit. Ouch - But the ping is much better with it though. Wierd – Piotr Kula Nov 14 '13 at 18:16
  • Right. I ditched the GPIO power supply used a HTC charger and plugged it in to micro USB. LAN on PI USB. I get 5.7Mbits now!? Exactly the same nano WiFi. I get weird lines on the camera now. I hate these power supplies :( And the Wifi drops out out now and again but that is lack of power. – Piotr Kula Nov 14 '13 at 18:31
  • I dug a new 2A power supply, fitted a DC socket to the GPIO pins and I get a much more stable connection now- 5mbits. Still not what I expect really. I am going to order an edimax and see if that helps. If not time to get Rev2 board. If that doesn't work.. I'm throwing in the towel.(I have another ReV1a board that does the same with the dongle) – Piotr Kula Nov 14 '13 at 21:16
  • Do you have a wireless keyboard / mouse? I have this issue and wifi speed drops to almost zero when the wireless keyboard / mouse dongle is plugged in. When removed, Wifi speed is ok. – Max N Jan 02 '17 at 22:26
  • Yea I do have one... but I think this speed issue was when it was plugged in another room, without KB. I could hardly use SSH or it just kept dropping out. Normally I have signal on my phone at 4 times that distance outside the house... really weird. But it may have been power supply issues or something.. never solved it though – Piotr Kula Jan 03 '17 at 13:16

3 Answers3

2

It could it be related to power management.

Perhaps turn it off in the driver

sudo nano /etc/modprobe.d/8192.cu.conf

add the line

options 8192cu rtw_power_mgnt=0 rtw_enusbss=0
Piotr Kula
  • 17,307
  • 6
  • 65
  • 104
1

I got the same problem when 802.11n not enabled at my hostapd config. More detailed explanation can be found here.

You have to append below configuration to your hostapd.conf file:

wme_enabled=1
ieee80211n=1
ht_capab=[HT40+][SHORT-GI-40][DSSS_CCK-40]

Bonus tip

Feed the usb adapter with external power supply. Even though I enabled the 802.11n, the speed was nowhere near what it supposed to be. It turns out the usb output of raspberry pi b+ is not enough to feed the adapter.


Bonus problem :)

With high wireless traffic, lets say torrent, raspberry pi stalls the wireless connection without shutting down it self. Whenever this occurs the adapter seems to be heated some amount. I am still trying to solve this problem. Probably this is related adapter itself and I should ask for a solution under different topic. Still wanted to mention it.

Cheers

1

I noticed that when I hold the dongle in my hand the speed jumps from 5K/s to 2M/s. I made several experiments and confirmed that holding the dongle in the hand or wrapping it with aluminium foil increases the speed consistently.

I have no idea why what I said above helps. I suspect antenna designers might have some explanation.

Bex
  • 2,929
  • 3
  • 25
  • 34