FTP connection for Volumio

Discuss, contribute and orient Volumio development!

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.

FTP connection for Volumio

Postby sstefanov » Mon Apr 14 2014 14:36

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!
Random avatar
sstefanov
Fresh off the boat
Fresh off the boat
 
Posts: 5
Joined: Sat Apr 12 2014 06:45

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.


FTP connection for Volumio

Postby davidov » Mon Mar 30 2015 20:33

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.
Random avatar
davidov
Fresh off the boat
Fresh off the boat
 
Posts: 3
Joined: Mon Mar 30 2015 20:26


Re: FTP connection for Volumio

Postby solaar1974 » Tue Mar 31 2015 08:38

I have a default access SMB , FTP ...
User avatar
solaar1974
Serious Listener
Serious Listener
 
Posts: 85
Joined: Thu Nov 20 2014 12:45
Location: Kharkiv, Ukraine


FTP connection for Volumio

Postby davidov » Wed Apr 01 2015 21:13

Do you have FTP access by default? How?
Random avatar
davidov
Fresh off the boat
Fresh off the boat
 
Posts: 3
Joined: Mon Mar 30 2015 20:26


FTP connection for Volumio

Postby davidov » Wed Apr 01 2015 21:19

I just realized that SFTP is working on the port 22. Sorry for the noob question..
Random avatar
davidov
Fresh off the boat
Fresh off the boat
 
Posts: 3
Joined: Mon Mar 30 2015 20:26


FTP connection for Volumio

Postby pinboke » Tue Apr 21 2015 00:18

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,
Random avatar
pinboke
Fresh off the boat
Fresh off the boat
 
Posts: 1
Joined: Mon Apr 20 2015 23:49


FTP connection for Volumio

Postby Phil29N » Mon May 25 2015 19:49

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
Random avatar
Phil29N
Fresh off the boat
Fresh off the boat
 
Posts: 1
Joined: Mon May 25 2015 19:42


FTP connection for Volumio

Postby Mr.Defreeze » Tue Oct 06 2015 16:14

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.
Random avatar
Mr.Defreeze
Fresh off the boat
Fresh off the boat
 
Posts: 2
Joined: Tue Oct 06 2015 16:08


FTP connection for Volumio

Postby Mr.Defreeze » Tue Oct 06 2015 16:52

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
Random avatar
Mr.Defreeze
Fresh off the boat
Fresh off the boat
 
Posts: 2
Joined: Tue Oct 06 2015 16:08


FTP connection for Volumio

Postby Taha » Wed Nov 18 2015 08:09

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.
Raspberry PI2 -> iFi iDSD Micro -> Sennheiser HD600
User avatar
Taha
Fresh off the boat
Fresh off the boat
 
Posts: 5
Joined: Sat Oct 24 2015 10:34


Return to Development talks

Who is online

Users browsing this forum: No registered users and 0 guests