[19. April 2013] A-400 Advanced Network Setup now available | [11 Jan. 2013] Customize your A-400 Home Screen

Firmware: A-400 [13 May 2013] | C-300 [30 Nov. 2012] | A-300 [30 Nov. 2012] | C-200 [21 Jan. 2013] | A-200/A-210 [10 Aug. 2012]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Post Reply 
On-Demand network share mounting
02-22-2009, 09:18 PM (This post was last modified: 02-22-2009 09:23 PM by mar_tin.)
Post: #16
RE: On-Demand network share mounting
Here is the relevant part of the setting.txt

Code:
servname3=Media
link3=smb://CUBESTATION/media
servlink3=smb://CUBESTATION/media&smb.user=martin&smb.passwd=******

Is it possible that the problem is that the share is password protected?

Edit: I quickly tried out with one of my non passworded share and it works.

Code:
mountFilesystemByPath
input: file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/Kiiratlan/Anime/Ghost in the Shell.mkv
mountFilesystemByName: Kiiratlan

urlencodeQuery: smb://MARTIN02/Kiiratlan&smb.user=&smb.passwd=
smb%3A%2F%2FMARTIN02%2FKiiratlan&smb.user=&smb.passwd=
performing mount: http://127.0.0.1:8883/smbclient.cgi?smb.cmd=mount&smb.opt=smb%3A%2F%2FMARTIN02%2FKiiratlan&smb.user=&smb.passwd=&smb.name=Kiiratlan
executeMono
/bin/mono.real '-single' 'file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/Kiiratlan/Anime/Ghost in the Shell.mkv' '-dram' '1'single

Media player 01: PCH-A100, 160 GB 2,5" WD HDD, Composite, CAT5 wired.
Media player 02: PCH-C200, 320 GB 2,5" Samsung HDD, LG CH10-LS20 BD, HDMI, CAT5e wired.
Display: Samsung LE-40R88BD
A/V receiver: Yamaha RXV-630 coax conn.
NAS: Synology CS407e, DS411j 8 TB (RAID5)
Find all posts by this user
Add Thank You Quote this message in a reply
02-22-2009, 09:46 PM
Post: #17
RE: On-Demand network share mounting
looks like the problem is there a a link= line between servname and servlink. I can easily adjust the function to take care of this though. Passwords should work but i havn't tested that part locally, i'll see if i can set up a share with a password for that. Should have one more new version of mono.wrapper tonight Smile

journey4712
Find all posts by this user
Add Thank You Quote this message in a reply
02-22-2009, 10:56 PM
Post: #18
RE: On-Demand network share mounting
Ok, i've tweaked the routine so it should properly match up the servname to the servlink no matter the order of /tmp/setting.txt. The new file is mono.wrapper-0.04.zip.

You can install this right over the old version, i've also updated the first post in the thread.

journey4712
Find all posts by this user
Add Thank You Quote this message in a reply
02-23-2009, 01:51 AM (This post was last modified: 02-23-2009 01:52 AM by excal.)
Post: #19
RE: On-Demand network share mounting
Just tested it out with 2 test shares i made.... Seems to work perfect for me.

Installation went smooth, and no hiccups.

Tried it after a reboot, no problems there either.

Thanks for the awesome work man.
(btw, i used version 0.04 if it matters)
Find all posts by this user
Add Thank You Quote this message in a reply
02-23-2009, 02:14 AM
Post: #20
RE: On-Demand network share mounting
Great work. I will try this out tonight. Right now i have all my shares mapped at startup using start.sh
Find all posts by this user
Add Thank You Quote this message in a reply
02-23-2009, 04:28 AM (This post was last modified: 02-23-2009 05:04 AM by halfelite.)
Post: #21
RE: On-Demand network share mounting
Ok i tried it. Doesnt seem to work. i have password protected shares also. I used version. mono.wrapper-0.04.zip.

Ok tried with no password protected share and no username. Still doesnt work. Looks like it doesnt work with LLink nothing is even showing up in mono.log.
Find all posts by this user
Add Thank You Quote this message in a reply
02-23-2009, 05:34 AM
Post: #22
RE: On-Demand network share mounting
this is my setting.txt
Code:
servlink1=smb://192.168.0.8/Movies&smb.user=xxx&smb.passwd=xxxx
link1=smb://192.168.0.8/Movies                                    
servname2=Anime                                                    
servname3=TV-Shows                                                
subtitle=eng                                                      
photo_transition=4                                                
servlink2=smb://192.168.0.8/Anime&smb.user=xxxx&smb.passwd=xxxx
link2=smb://192.168.0.8/Anime                                      
dhcp=0                                                            
eth_ipaddr=192.168.0.103                                          
eth_netmask=255.255.0.0                                            
ihome=0                                                            
smbserv=0                                                          
servname4=x264                                                    
link4=smb://192.168.0.8/x264                                      
servlink3=smb://192.168.0.8/TV-Shows&smb.user=xxxx&smb.passwd=xxx
link3=smb://192.168.0.8/TV-Shows                                    
volume=-20                                                          
mute=0                                                              
servlink4=smb://192.168.0.8/x264&smb.user=&smb.passwd=
Find all posts by this user
Add Thank You Quote this message in a reply
02-23-2009, 05:39 AM (This post was last modified: 02-23-2009 05:43 AM by journey4712.)
Post: #23
RE: On-Demand network share mounting
Hmm, if you dont have /tmp/mono.log then there is something else odd going on, sounds more like an installation issue. Even if the mono wrapper doesnt do anything it should still put a line in mono.log just saying that its going to start the regular mono.

try the command `ls -l /bin/mono` from telnet, it should say
Code:
lrwxrwxrwx 1 root root 4 Aug 25 14:31 /bin/mono -> /share/Apps/Mono.Wrapper/mono.php

If that isn't set properly, try running /share/Apps/Mono.Wrapper/init.sh and then check /bin/mono again. If init.sh works to set it up, but its not being automatically setup check that init.sh made it into /share/start_app.sh.


journey4712
Find all posts by this user
Add Thank You Quote this message in a reply
02-23-2009, 05:41 AM
Post: #24
RE: On-Demand network share mounting
Thanks for this Journey -- added to my "to test" list.

Something to think about...
It would be cool if I could send an http request to the PCH from my NAS and PC whenever they are shutdown or rebooted.

Right now I believe that the PCH has no knowledge of a NAS going into sleep mode or shutdown.
On my NAS, I would like to be able to let the PCH (2 of them) know that it is being shutdown, that way it can un-mount
the share if the NAS is the active one, or refuse if a movie is being played.
Once the NAS comes back on, it could send another call to broadcast that it's ready.

Same concept for shutdown of a PC, un-mount shares that are mounted on the PCH.

Why? I did a reboot of PCH-2 and the next time my kids were using PCH-1 and tried to access PCH-2 as a share or myihome service,
it just reported "Request could not be processed".
When I went to Network Browse, that's when I was forced to enter username and password for PCH-2.
Find all posts by this user
Add Thank You Quote this message in a reply
02-23-2009, 05:51 AM (This post was last modified: 02-23-2009 06:38 AM by halfelite.)
Post: #25
RE: On-Demand network share mounting
(02-23-2009 05:39 AM)journey4712 Wrote:  Hmm, if you dont have /tmp/mono.log then there is something else odd going on, sounds more like an installation issue. Even if the mono wrapper doesnt do anything it should still put a line in mono.log just saying that its going to start the regular mono.

try the command `ls -l /bin/mono` from telnet, it should say
Code:
lrwxrwxrwx 1 root root 4 Aug 25 14:31 /bin/mono -> /share/Apps/Mono.Wrapper/mono.php

If that isn't set properly, try running /share/Apps/Mono.Wrapper/init.sh and then check /bin/mono again. If init.sh works to set it up, but its not being automatically setup check that init.sh made it into /share/start_app.sh.


journey4712

All of that checks out.
/tmp # ls -l /bin/mono
lrwxrwxrwx 1 root root 33 Feb 22 20:54 /bin/mono -> /share/Apps/Mono.Wrapper/mono.php

if i run echo "212" > /tmp/irkey. which i guess crashes mono. then it will make a log file to mono.log.

and i get

Code:
/tmp # cat /var/tmp/mono.log
single
mountFilesystemByPath: file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/Movies/Moviesfolder/Movie.avi
mountFilesystemByName: Movies
Movies already mounted
executeMono
/bin/mono.real 'single' 'file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/Movies/Moviesfolder/Movies.avi '-dram' '1'
Find all posts by this user
Add Thank You Quote this message in a reply
02-23-2009, 06:24 AM (This post was last modified: 02-23-2009 06:29 AM by journey4712.)
Post: #26
RE: On-Demand network share mounting
@garp
Hmm, should be possible to create something like that. The only thing i'm not sure of yet is how to inform the NMT that the share has been unmounted. It can easily be unmounted with the umount command, but then the next time you click on that disk in the source menu the NMT still thinks its mounted.

@halfelite
Ok, so clicking on a video link for a drive not mounted presents you with the file not found, a video link for a mounted drive works normally, but neither puts anything in your /tmp/mono.log. Echoing 212 into /tmp/irkey creates a mono.log, but then causes a segfault? is the segfault in the wrapper or in the real mono program(i suppose might not be able to tell)?, also what does echoing 212 into /tmp/irkey normally do, play button? What all makes it into mono.log when you do the echo, trying to figure out how far it got through the script.

Should be able to figure this out, i'm just not sure whats going on yet.

journey4712
Find all posts by this user
Add Thank You Quote this message in a reply
02-23-2009, 06:27 AM (This post was last modified: 02-23-2009 06:33 AM by halfelite.)
Post: #27
RE: On-Demand network share mounting
(02-23-2009 06:24 AM)journey4712 Wrote:  Ok, so clicking on a video link for a drive not mounted presents you with the file not found, a video link for a mounted drive works normally, but neither puts anything in your /tmp/mono.log. Echoing 212 into /tmp/irkey creates a mono.log, but then causes a segfault? is the segfault in the wrapper or in the real mono program(i suppose might not be able to tell)?, also what does echoing 212 into /tmp/irkey normally do, play button? What all makes it into mono.log when you do the echo, trying to figure out how far it got through the script.

Should be able to figure this out, i'm just not sure whats going on yet.

journey4712

Just put whats in mono.log above your post. It looks like it logs. just not creating mono.log till mono closes and reopens.

And to tell the truth. I went searching why i wouldnt get a mono.log and found this thread.

http://www.networkedmediatank.com/showth...#pid141742

were it said mono.log wasnt there.
Find all posts by this user
Add Thank You Quote this message in a reply
02-23-2009, 06:34 AM (This post was last modified: 02-23-2009 06:38 AM by journey4712.)
Post: #28
RE: On-Demand network share mounting
Ok, so that log shows the program seems to think the share is already mounted, but then if the video isn't playing in mono then its obviously not mounted. I'll double check over that code and see what i can think of.


journey4712

EDIT: there also appears to be an odd part in your log, the file passed to mono has an additional -diety.avi after the regular filename, i'm a touch confused about how that got in there.

As to the log being created after mono closes, thats actually just the result of how i wrote the wrapper script, didn't occur to me that it would make a difference, but it does make sense. Basically while mono is running the mono.wrapper script is still running in the background, and then the vary last thing my script does before exiting is write out the log, as opposed to some progs which write to the log on every message.
Find all posts by this user
Add Thank You Quote this message in a reply
02-23-2009, 06:37 AM (This post was last modified: 02-23-2009 06:38 AM by halfelite.)
Post: #29
RE: On-Demand network share mounting
(02-23-2009 06:34 AM)journey4712 Wrote:  Ok, so that log shows the program seems to think the share is already mounted, but then if the video isn't playing in mono then its obviously not mounted. I'll double check over that code and see what i can think of.


journey4712

EDIT: there also appears to be an odd part in your log, the file passed to mono has an additional -diety.avi after the regular filename, i'm a touch confused about how that got in there.

Sorry the diety.avi was part of the avi file name. messed the edit.

Since i dont get a mono.log would it be best if i tried to reload to factory settings or reflash the firmware.
Find all posts by this user
Add Thank You Quote this message in a reply
02-23-2009, 06:44 AM (This post was last modified: 02-23-2009 08:01 AM by journey4712.)
Post: #30
RE: On-Demand network share mounting
Well, actually the easiest way to get the log to write out might be to just test a simpler _log() function. If you open up mono.php almost at the top is the following
PHP Code:
function _log($msg) {
  static 
$output = array();

  if(
DEBUG) {
    if(
$msg === TRUE) {
      
file_put_contents(LOGimplode("\n"$output), FILE_APPEND);
      if(!
IS_NMT)
        echo 
implode("\n"$output);
    } else {
      
$output[] = $msg;
    }
  }
  return 
$msg;


just simplify that to
PHP Code:
function _log($msg) {
  
file_put_contents(LOG$msg."\n"FILE_APPEND);
  return 
$msg;


That should hopefully force the script to write out the log immediatly every time.

journey4712

EDIT: I took a browse over that thread you posted, its the same filename but unrelated to this. That thread is about the output from the mono program, in this thread mono.log is the output of my wrapper script.

EDIT2: I've had a chance to page through the mono.php code a bit, without the system writing log files probably not much to do. I'm not sure which would be better reset or reflash, if its not a big issue either would probably be a good test.
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Streaming from PCH to network naight 9 3,426 02-11-2011 05:26 PM
Last Post: naight
  Stream movie audio over network Irri 0 1,454 11-06-2010 11:52 AM
Last Post: Irri
  PCH doesn't share my USB drive anymore Danishdude 5 2,255 08-30-2010 04:38 PM
Last Post: Willem53
  Transmission and network hd hairball 3 1,808 07-08-2010 10:26 AM
Last Post: hairball
  edit network share from within a100 graf 7 2,240 07-08-2010 01:08 AM
Last Post: graf
  Problem mounting windows shares after reset kruuth 0 1,179 06-22-2010 06:14 AM
Last Post: kruuth
Sad Problem reading network dir jaccoswart 2 1,709 06-13-2010 11:00 AM
Last Post: jaccoswart
  Re-enable the network share from command line? glorifyday 0 1,842 03-04-2010 05:06 PM
Last Post: glorifyday
  Gigabit USB network adapter? tiwas 3 2,334 01-29-2010 11:55 AM
Last Post: ASD2003ru
  mounting hdx shares from Linux - read only schnaaf 0 1,210 01-24-2010 01:21 PM
Last Post: schnaaf

Forum Jump: