Downloading files on SCP always interrupted at 500 MB

When I try to download a file from my Banana PI R3 router, which is ruinning OpenWRT 23.05.02 the download stops always before 500 MB (499974144 or 499941376 bytes)
Why? And how can I solve this problem?

I tried 2 different SCP clients: WinSCP 6.3.3 and FAR Manager.

The files are on an external USB drive on an NTFS partition.
If I connect the HDD to my laptop, it works.. so the files are OK.

Thank you.

copy the file(s) from the HDD to /tmp, does the same issue occur when you do the transfer from there ?

Yes, the same error occurs from /tmp.

and what's the error on the router and client ends ?

My guess would be RAM being a limiting factor.


How can I check the error on the router?

why? wants to load the whole file into memory? why is it needed?

it has 2GiB ram... ok, it could be more, but this is already much more than most of the OpenWRT supported routers.

Check the system log.

There is no record for the problem. The password auth is logged when I connect, but after that only the same log messages which are shown earlier, too.

I found a solution. If I turn off the "Optimize connection buffer size" it works.
This setting exists both in WinSCP and FAR Manager.... both works when it is disabled...

But is this an OpenWRT issue, It should work even with this settingturned on, since by default it is turned on.

It can be as easy as monitoring top output or running free -m while running your SCP transfer. htop is even easier and installed in a jiffy.

1 Like


The default ssh / scp server in OpenWrt is dropbear. This program is designed primarily to have a small size in flash and RAM. It may not work the best with large files etc. The openssh-server package can replace dropbear. It is a port of the program usually used on desktops and other systems not constrained by flash or RAM.

1 Like

Disabling the "Optimize connection buffer size" solves my problem, so this server is OK for me.
But the limit when it stops (5*10^8 byte) is strange, why this value, why not 512 MiB?... it seems to be some hardcoded limit. Not the actual memory limit, since it is still a big value for routers.
So it seems to be a bug, not a design decision for low memory devices.

Anyway sooner or later this issue shoud be solved (maybe not in OpenWRT), since hopefully later (in 10-20 years:)) the low-end devices will also have 1-2GiB RAM.