Page 1 of 1

FTP connection for Volumio

PostPosted: Mon Apr 14 2014 14:36
by sstefanov
Hello

I have media tank with a lot of music but it can be reached as server only by ftp. I'd like to be able to connect my new Volumio to tank's FTP and I tried to add this possibility.
(I'm not PHP programmer, so there can be errors, please fix them if possible)

How to add connection to FTP server:

1. Install curlftpfs (as root):
Code: Select all
apt-get install curlftpfs


2. Add user pi to group fuse (as root):
Code: Select all
usermod pi -a -G fuse


3. Uncomment line user_allow_other in file /etc/fuse.conf (as root):

4. Edit files in /var/www as follows:

file inc/player_lib.php
function wrk_sourcemount($db,$action,$id) {
after line
$mountstr = "mount -t nfs -o ".$mp[0]['options']." \"".$mp[0]['address'].":/".$mp[0]['remotedir']."\" \"/mnt/NAS/".$mp[0]['name']."\"";

add
Code: Select all
} elseif ($mp[0]['type'] == 'ftpfs') {
         // ftpfs mount
         $mountstr = "curlftpfs ftp://\"".$mp[0]['username'].":".$mp[0]['password']."@".$mp[0]['address']."/".$mp[0]['remotedir']."\" \"/mnt/NAS/".$mp[0]['name']."\"";


function wrk_sourcecfg($db,$queueargs) {
after line
foreach ($source as $mp) {
replace
sysCmd("umount -f \"/mnt/NAS/".$mp['name']."\"");
with
Code: Select all
if ( $mp['name']=='ftpfs' || $mp['name']=='sshfs') {
            sysCmd("fusermount -u \"/mnt/NAS/".$mp['name']."\"");
         } else {
            sysCmd("umount -f \"/mnt/NAS/".$mp['name']."\"");
         }


file sources.php:
after line
$_source_select['type'] .= "<option value=\"nfs\" ".(($mount['type'] == 'nfs') ? "selected" : "")." >NFS</option>\n";

add
Code: Select all
$_source_select['type'] .= "<option value=\"ftpfs\" ".(($mount['type'] == 'ftpfs') ? "selected" : "")." >FTP</option>\n";


after line
$_source_select['type'] .= "<option value=\"nfs\">NFS</option>\n";
add
Code: Select all
$_source_select['type'] .= "<option value=\"ftpfs\">FTP</option>\n";   


5. Reboot Volumio.

After that FTP option in Library page should be available. Just fill fields as NFS mount and click SAVE button.
You should have new NAS directory connected to FTP server!

FTP connection for Volumio

PostPosted: Mon Mar 30 2015 20:33
by davidov
Thank you for the guide!
I have a problem though. After this section:

file inc/player_lib.php
function wrk_sourcemount($db,$action,$id) {
after line
$mountstr = "mount -t nfs -o ".$mp[0]['options']." \"".$mp[0]['address'].":/".$mp[0]['remotedir']."\" \"/mnt/NAS/".$mp[0]['name']."\"";
Code: Select all
} elseif ($mp[0]['type'] == 'ftpfs') {
         // ftpfs mount
         $mountstr = "curlftpfs ftp://\"".$mp[0]['username'].":".$mp[0]['password']."@".$mp[0]['address']."/".$mp[0]['remotedir']."\" \"/mnt/NAS/".$mp[0]['name']."\"";



I cannot reconnect with the web interface. The device boots up, I can SSH in, but no web interface. I use 1.55 version.

Do you have any suggestion what could be wrong? Thx.

Re: FTP connection for Volumio

PostPosted: Tue Mar 31 2015 08:38
by solaar1974
I have a default access SMB , FTP ...

FTP connection for Volumio

PostPosted: Wed Apr 01 2015 21:13
by davidov
Do you have FTP access by default? How?

FTP connection for Volumio

PostPosted: Wed Apr 01 2015 21:19
by davidov
I just realized that SFTP is working on the port 22. Sorry for the noob question..

FTP connection for Volumio

PostPosted: Tue Apr 21 2015 00:18
by pinboke
Hello,

I have the same problem and no solutions so far. Can anybody illuminate me here?
After I have modified my player_lib.php file, WebUI from my phone is not responding at all.
The main terminal keeps showing some error messages like "cat : ...player_wrk.pid... no such file or directory."
The problem goes away once I restore the original player_lib.php file, without mounting my ftp NAS.
BTW, I do not understand that some of you have default access to sftp in Volumio, which does not show up in my WebUI at all.
I use Volumio 1.55 on Raspberry pi B.

Cheers,

FTP connection for Volumio

PostPosted: Mon May 25 2015 19:49
by Phil29N
Hi,

Had a same issue, worked it out in step '4':

file inc/player_lib.php
function wrk_sourcemount($db,$action,$id) {

after line
$mountstr = "mount -t nfs -o ".$mp[0]['options']." \"".$mp[0]['address'].":/".$mp[0]['remotedir']."\" \"/mnt/NAS/".$mp[0]['name']."\"";

should better be:
after line
$mountstr = "mount -t cifs \"//".$mp[0]['address']."/".$mp[0]['remotedir']."\" -o username=".$mp[0]['username'].",password=".$mp[0]['password'].",rsize=".$mp[0]['rsize'].",wsize=".$mp[0]['wsize'].",iocharset=".$mp$


This way the open 'else' closes the if-else statement. It worked for me.

Phil

FTP connection for Volumio

PostPosted: Tue Oct 06 2015 16:14
by Mr.Defreeze
Also, before you can install curlftpfs. Do a sudo update.

But even after you are able to get the ftp to work. There is still the following error.

fuse: warning: library too old, some operations may not not work

Didn't get it to work... yet.

FTP connection for Volumio

PostPosted: Tue Oct 06 2015 16:52
by Mr.Defreeze
And for that you need to update the fuse package. It will make the "fuse: warning: library too old, some operations may not not work" go away.

Or at least hide it... Because then ftp mount will not show up in the Browse thingy.

So there you have it folks.

Oktober 2015

This Wont Work

FTP connection for Volumio

PostPosted: Wed Nov 18 2015 08:09
by Taha
sstefanov wrote:Hello

I have media tank with a lot of music but it can be reached as server only by ftp. I'd like to be able to connect my new Volumio to tank's FTP and I tried to add this possibility.
(I'm not PHP programmer, so there can be errors, please fix them if possible)
.....


Hi, what kind of media tank do you have? I have popcornhour, volumio can see it in my home wifi network and connect as NAS.