FTP and scp killing network connection

I have a Raspberry Pi 2 setup with OSMC Alpha 4 installed (using a micro SD) - everything is up to date and I have enabled the root user. I have also installed the FTP app and I am able to FTP in as root. I have a 2TB USB HDD connected to the Pi that is formatted as exFAT (so it will still work on my Mac when I need it to).

When I FTP into the Pi as root, it works at first - I can browse the file system as well as the USB HDD. I can also edit files (delete, move, etc.) on the USB HDD. But if I try to copy a file from my local machine to to the USB HDD via FTP it loses the connection during the transfer and, more than that, the Pi’s network connection is completely lost. The only way to get the network connection back is to reboot the Pi.

Additionally, while I can SSH into the Pi as root and copy/move files as much as I like with no concerns regarding the network connection, when I use scp I have the same problem as the FTP transfer - the network connection is lost during the first file transfer attempt.

All of this happens no matter whether I am copying files to the USB HDD or just to the Pi’s SD card.

With all that in mind, I have the following questions:

  1. Why do FTP and scp kill the Pi’s network connection and how can I prevent that from happening?
  2. It feels like copying files via Samba might be a better option here, but I’m not 100% sure on how to set that up (I attempted it previously, but had to reinstall OSMC because I messed up some config files), so is that possible and how do I do that?

If you need any more info then let me know. It might be helpful to know that my local machine is a Mac and not a Windows machine, but I’m not sure what else is relevant.

Any help you guys could offer would be super valuable :slight_smile:

My current ‘solution’ is to either just connect the HDD into my Mac and copy the files that way, or (to save me moving my hard drive around) copy the files onto a flash drive then connect the flash drive to the Pi and move the files from the flash drive to the USB HDD via SSH. That all works just fine - the issue only comes in when copying files from my local machine to the Pi.

is the raspberry pi 2 on wifi? then i would recommend you to ether have the USB disk and wifi on an powered USB hub or add som extra power to the USB through OSMC settings… possible with RPI 2.

How big are the SD card?

The Pi is on wifi (using this wifi adapter) - it’s not in a position to have a wired connection. The USB HDD has it’s own power supply, so it doesn’t actually draw any power from the Pi itself. Is it possible that it still does though?

When I’m home later I’ll look through the settings to see if I can add some extra power there, but not sure how much difference that will make. I’m sure I can work out how to do it (not in front of my Pi right now), but if you could give me a quick guide if possible that would be helpful.

The SD card is 32 GB - this one.

Done some more research into power supplies and I think part of the problem is that I am powering my Pi from the TV directly. I didn’t realise this would cause a problem, but it looks like it does. I’m getting the multi-coloured block appearing in the top corner occasionally, which seems to be a good indicator as well.

I’ve found a 5V 2A power supply available locally, so that’s all good. Just a query then before I get it sorted out - I currently use my Sony Bravia TV remote to control the Pi via HDMI. If I shut down the Pi after use, then when I switch on my TV, will it automatically power up the Pi? I’m just trying to find the best way to manage it without worrying about multiple remotes, etc.

PIs are not designed to be poweroff/on on demand. Just leave it working. When idle it’ll consume very little power.

AFAIK there is no “wake on” anything possibility with PIs

OK thanks. I’m getting the power supply this weekend, so will test it all out then. I’ll see what I can do to get the best wake solution. Thanks.

usually(at least my samsung TV) only provides 500ma, with is to little for a pi with USB wifi… RPI 2 need at least 1A PSU, and i recommend more than that!.

That say’d… wifi and TV signal from my experience do not work well in close proximity…

and as @msieminski say’s just leave the pi on all the time, i have 2 running 24/7.

OSMC setting i was referring to is called “usb_max_current” i have to have it on when i see content that require bandwith like HD/DVR recordings…

You’ll find in in OSMC settings PI config >> “CPU Mem & Cocec”.

Thanks - I found that setting, so will use that along with a new power supply and that should clear up all these problems.

Thanks for the input guys!

The new power supply along with the usb_max_current setting has solved this issue. FTP is slightly faster and it no longer crashes.

I have one follow up question regarding how to trigger a fresh library scan remotely, seeing as though my Pi is on permanently now, but I’ll open a fresh topic for that if I can’t find any other answer.

There is not one way, you can send a remote command with http/json or install an addon that does it on a timer… there is no builtin automatic way… my self i would like an funktion that discovers(inotify or something) that tricker an scan…

Thanks @HarryL - I’ve worked out how to do this from the command line and the solution is here: [SOLVED] Xbmc-send giving error :smile:

why don’t you use RSYNC . it is easier to transfer

you log to osmc using ssh . then install ftpd . then transfer the file that you want

Thanks - I’ll check that out :slight_smile:

This whole issue seems be all sorted out on RC2 :smiley:

FTP transfer is still very slow over wifi, but it’s working without crashing anymore. I can handle it being slow as long as it works, but I really wish it could be faster.