# Is there any way to send files to raspberry faster?

I have a Raspberry Pi with Raspbmc installed, and I would like to send some files from my computer to Raspberry via Wifi.

I've tried two ways:

• Send it using a shared folder
• Using sftp (with filezilla client)

Both worked ok but I feel that are extremely slow. For example, it takes about 1 hour to send a 1'5GB video file.

Is this a wifi limitation? Or is there any way to send files to raspberry faster?

• Please provide more information. 1. What WiFi device are you using? 2. Take a look at the link quality with iwconfig 3. Can you try to send some dummy data via netcat, and measure the timings? 4. Have you tried using wired ethernet, to rule out problems with sftp or the Pi itself? – Arne Oct 15 '13 at 14:30
• What is the transfer rate of the files going up and what speed is your WiFi? Can you transfer files faster between other computer on Wifi faster than to the Pi? – Piotr Kula Oct 15 '13 at 14:31
• The bottleneck is probably the CPU on the Pi. Try running top while transmitting a file. See what process uses the most CPU. – Gerben Oct 15 '13 at 16:52
• If copying to a class 4 SD card it will be slower. Class 10 will improve your writing speed. Have raspbmc and can copy 1.5gb mkv to the pi in less than 10mins on wifi. Even better is NFS (FreeNAS) no copying required streams on demand. – Mapperz Oct 15 '13 at 20:15

Wireless is very generalised and mis understood.

You need to examine your Wireless configurations before you can try and adjust speed.

Many new routers come pre configured to run in mixed mode, using both the g and n standards. This is great if you want all your devices to work together but it becomes a real problem when you start to transfer large amounts of data.

You can mostly solve speed issues by changing your router into a dedicated mode. Either g or n. The reason is that ALL clients connect run on the same channel and frequency. The router does not have to switch between modes. The problem becomes apparent on heavily used routes in mixed mode where it seems to stutter, loads, stops, loads, stops, loads, stops.

To overcome speed issues I have configured my newest router to use Wireless N 5Ghz and enabled dual channel "40 Mhz" giving me 70 Mbps~150 Mbps per channel. Another older router with Wireless G 2.4Ghz. Both are dedicated to those modes and if I cannot connect to the newest N standard I fall back to G.

That ended all my internetting Wireless connectivity issues and ensures the Routers handle data at the maximum speed.

My Pi uses a Wifi n USB that is capable of connecting to 5Ghz network and I can send files to it at a speed of 50Mbps (about 6.25 Megabytes per second) - That is the maximum limit also caused by a cheaper SD card I am using but I can read from the Pi allot faster!

You should check that you are not cross talking with other routers on the same channel. Use inSSIDer to evaluate what channel you are on and which ones are free to use. This can dramatically increase Wifi performance too!

Overclocking

FYI - I suggest you do not overclock your Pi. This causes problems with Wifi and LAN. This is one of the first things I also enabled and it really drove me mad with the poor performance of Wifi.

• One note: 5GHz is fine, but has much heavier attenuation. I.e. the range will be much shorter than at 2.4GHz. My flat goes over two levels in the building, and I cannot use 5GHz with my downstairs RasPi connected to the upstairs router. My iwconfig shows 150MBit for 2.4GHz and I get 1.9MB/s (or 15.2MBit/s) of net throughput via SMB. – Arne Oct 16 '13 at 13:14
• PS: this is with writing to a USB NTFS disk, which all in all leads to 50-60% CPU load on the RasPi (dynamic overclocking to 900MHz). – Arne Oct 16 '13 at 13:15
• OH. Overclocking does NOT work well with WiFi and LAN. I recommend you do NOT overclock! I also did this and had terrible networking issues! – Piotr Kula Oct 16 '13 at 13:21
• I am using OC and WiFi for at least half a year now -- my RasPi runs 24/7 as a file server, MPD server and AirPlay target. I reboot it about once a month, because of memory fragmentation (I only have the old 256MB version). I had problems before, but only with one kind of WiFi dongle (RaLink). When I switched to a Realtek Nano USB WiFi dongle, all problems went away. YMMV – Arne Oct 16 '13 at 14:29
• Just try without OC and see what it does. Agreed I also use some RaLink N dongle. I use LAN as its just more stable long run. – Piotr Kula Oct 16 '13 at 14:49

Wifi speeds are often rated in Mbps -- the dongle you are using on the pi is probably 150 or 300 Mbps. If you have a decent router and are running an unencrypted dedicated 802.11n network, you may be able to get close to that when transferring data between two points in your WLAN (but I very much doubt it).

I'm not sure the extent to which WEP/WPA slow things down -- I have not benchmarked this, and searching for such doesn't turn much up, so lets assume it is not particularly significant. So, going with 8 megabits per megabyte and 3600 seconds in an hour, at 200 Mbps:

200 * 3600 / 8 / 1000 = 90


About 90 GB in one hour. I never transfer that much at a time, and in reality never get anything like that speed. I just tested a transfer using a 150 Mbps dongle on a dedicated N network to the pi (at a very bad angle to the router) and the speed was ~1.5 MB/s, much less than the theoretical 150 / 8 = 18.75 MB/s, but still about 4 times faster than you.

So what you have going on is slow, but not out to lunch.

is there any way to send files to raspberry faster?

Ethernet ;) Keep in mind most other devices will probably be faster than the underpowered pi, so even if you just put it on the wire and transfer via wifi with the same router, your transfer speed will probably improve.

• unecrypted != decent WEP/WPA/WPA2 will not slow it down because routers use dedicated AES hardware for this. The only thing to slow it down is wireless noise, or the write speed to the SD card.n can run in 2.4 or 5ghz and also in dual channel 40 mhz to achieve 150mbs. 300Mbs is achieved by adding both channels and only if both transceivers support this. Usually cheap USB stick only support 1 channel N – Piotr Kula Oct 15 '13 at 14:53
• A simpler way to calculate Mega Bits (speed) to Mega Bytes (Size) is to divide by 8 or multiply to get Mega Bits from Mega Bytes. This is because there are 8 bits in a byte. – Piotr Kula Oct 15 '13 at 15:05
• @ppumkin You'll actually get slightly different numbers that way, since I'm using 1048576 bytes = 1 MB out of habit, although it is probably not so appropriate here. But close enough to give a general idea of speeds. – goldilocks Oct 15 '13 at 15:10
• I've changed that. – goldilocks Oct 15 '13 at 15:27
• Ethernet +1 =;) – Piotr Kula Oct 15 '13 at 15:32