Author Topic: Solution-Two options: How can I make NAS device stay Online?  (Read 5424 times)

pigdog

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1006
    • View Profile
I have a D-Link 323 NAS with 2 share volumes.  

Has   -username and password
   -use automatically
   -cifs
   -password required
   -readonly

but online has to be manually set.

How can I get Online active on boot?

P.S.  Device & Share volumes say Registered: no.
« Last Edit: July 14, 2009, 05:53:43 pm by pigdog »

jimmejames

  • Guru
  • ****
  • Posts: 183
    • View Profile
Re: How can I make NAS device stay Online?
« Reply #1 on: July 11, 2009, 08:00:51 pm »
I'm guessing you're using 810...  I have the same nas and the same problem.  I've tried putting it on the internal and external networks but get the same results.  I've also experienced that it seems to only go offline when I turn on some MDs and not others.

I'm also guessing that you at some point used 710 and, like me, did not experience this issue.

Btw, setting the system so it sends a singal every 5secs or so to keep the device online did not work for me.

I'm still obviously trying to figure it out so if you find a solution please share.

pigdog

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1006
    • View Profile
Re: How can I make NAS device stay Online?
« Reply #2 on: July 11, 2009, 08:18:51 pm »
Hi jimmejames,

Yes to the above.

I started with another problem and eventually ended up with no online.

I have reloaded from scratch.  Deleted the device from the device tree/pnpqueue etc., allowed re-discovery but no go.

You are using passwords - correct?

Will keep you informed.


jimmejames

  • Guru
  • ****
  • Posts: 183
    • View Profile
Re: How can I make NAS device stay Online?
« Reply #3 on: July 12, 2009, 12:15:21 am »
Yes, passwords and all media public.

I need to seriously play with it some more now that someone else has experienced the same.

I'm convinced that LMCE doesn't think it is offline, it only tells you that it is.  That is to say that if I have music playing on a MD and I turn on another MD (one that I know pushes the DNS-323 offline- my Dell Latitude 800) and no matter what MD I clicked on the audio button on, the list was not populated, even on the MD where the music was playing.  But, if I went to the remote on the MD where the music was playing (and still was even though the device was listed as offline) I could change songs and everything would play as though the device was still online.

To get the audio displayed on the MDs, I need to log into the admin pages, click the button to put the DNS-323 online and then quick reload the router. 

Couple things I want to try:
1) When audio is playing on one MD and not displayed under the audio button (repeatable by doing the above steps) use the follow me feature to push the audio onto a different MD to see if the audio plays
2) confirm that only some MDs push the DNS offline- I think I remember at least one not affecting the status
3) put a couple videos on this DNS to see if it's just an audio issue or if the video is affected as well


There was a post a year or so back (I think I recall) that talked about a MAC address or IP address range that was used to determine particular devices.  I think it was MAC addresses and that all starting with XX:XX:XX.whatever were say a camera and XX:XX:X1.whatever are NASes.  My DNS when it first configures comes up as a DLink camera and two other unrelated things.

Not sure that any of this helps

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4437
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: How can I make NAS device stay Online?
« Reply #4 on: July 12, 2009, 01:48:20 am »
I have a D-Link 323 NAS with 2 share volumes.  

Has   -username and password
   -use automatically
   -cifs
   -password required
   -readonly

but online has to be manually set.

How can I get Online active on boot?

P.S.  Device & Share volumes say Registered: no.

Hmmm...my response in this thread was about keeping storage from going off-line because of some bugs in the way the storageRadar scripts handle storage devices. Those bugs have not been fixed in the current 0810 builds;

http://forum.linuxmce.org/index.php?topic=7636.msg49121#msg49121

The above might be of help...

Andrew
« Last Edit: July 12, 2009, 11:17:20 am by totallymaxed »
Andy Herron,
Convergent Home Technologies Ltd
United Kingdom

Read My Blog; http://ellipticalcurve.com

Contact me for Smart Home consulting advice here;
@herron on Twitter, totallymaxed+consulting@gmail.com via email or PM me here.

Get a Dianemo S License: http://forum.linuxmce.org/index.php?topic=8880.0
iOS Orbiter: http://wiki.linuxmce.org/index.php/Dianemo_iOS_Orbiter
Follow us on Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

Sales & Info:
http://www.dianemo.co.uk

jimmejames

  • Guru
  • ****
  • Posts: 183
    • View Profile
Re: How can I make NAS device stay Online?
« Reply #5 on: July 12, 2009, 02:14:25 am »
Did anything chaned (delibertly) from 710 to 810 in regards to how lmce handles remote storage?  It's just odd that this wasn't an issue before and I would like to know where to behin looking if you have suggestions

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: How can I make NAS device stay Online?
« Reply #6 on: July 12, 2009, 10:49:19 am »
Can't really help with the underlying issue other than what I have already told pigdog in another thread. But I can say that the online tick box is a little misleading. The storageradar under some circumstances (such as the cifs/smbfs issue) thinks the storage is offline even though it isn't really. And marks it as such. But that is really only used by the Orbiter SQL queries to determine which media to display and which not to.

Neither Xine (the actual media player) nor UpdateMedia (the library scanning component) take any notice of this tick box... so if the media actually is online, UpdateMedia scans the media into the library, with attributes, etc, but perversely then notes that the device is supposedly offline and marks the media as missing! But it does populate the database... and Xine will happily play the media too, because of a bug in the search function it actually allows you to search for media that otherwise wouldn't be displayed because it is "offline" and allows you to play it, even though those files don't appear in the normal media grids. Hence the behaviour you are seeing.

Using Totallymaxed's approach is one step, but it would be worthwhile switching from cifs to smbfs as well as that also causes an "offline" issue. You only need tick the box and hit Save, not reload the router. It usually takes about 5-10 before it switches back to offline, if its going to, so wait, then hit refresh and see if it sticks. This particular issue is usually associated with numerous CIFS VFS errors on the console, some are normal, but I think that -111 is one of the error numbers..

pigdog

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1006
    • View Profile
Re: How can I make NAS device stay Online?
« Reply #7 on: July 12, 2009, 07:35:58 pm »
Hi,

I upgraded my DNS-323 to version 1.07 (from 1.04).

I noticed some timers were now disabled.

I removed all username/password stuff on the DNS-323 and made all accounts read/write.

I reloaded from scratch.

I had to apt-get install libdvdread3 (dvdnav downloaded as part of package).  That was odd (I'll check install log later).

Went into device tree for DNS-323 and checked settings.  Share volumes are checked for Auto-assign to parents, Readonly, Online (no Use Automatically).

I have all my media.  After 3 hours no changes.

I powered down Core/Hybrid via menu.  Powered down DNS-323.

Powered up Core/Hybrid and when loaded powered up DNS-323.  Have all my media.  Settings constant.

I reloaded from scratch before but couldn't get media.  http://forum.linuxmce.org/index.php?topic=8488.0

I guess it's fixed but not 100% sure why.  Could be the firmware upgrade on DNS-323.

What version are you at jimmejames?

jimmejames

  • Guru
  • ****
  • Posts: 183
    • View Profile
Re: How can I make NAS device stay Online?
« Reply #8 on: July 12, 2009, 08:15:37 pm »
1.05, but I'm going to go to 1.07 and post my results.


Thanks for the info

jimmejames

  • Guru
  • ****
  • Posts: 183
    • View Profile
Re: How can I make NAS device stay Online?
« Reply #9 on: July 12, 2009, 08:37:22 pm »
Sweet- thanks pigdog.   Updating to 1.07 seems to have fixed the problem.  

I started my Latitude which always sent the device offline and all of the media was there.  I didn't change anything in LinuxMCE, only updated the firmware and reloaded the router.

Mine is set up the same- read only, auto assign, online, but I am using a password.


Thanks again


Pigdog- try doing a quick reload of the router.  I've found that this kicks the NAS offline and I have to go to the admin pages and then reload.  But I am to start MDs without it going offline.
« Last Edit: July 12, 2009, 08:51:13 pm by jimmejames »

pigdog

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1006
    • View Profile
Re: How can I make NAS device stay Online?
« Reply #10 on: July 12, 2009, 11:23:40 pm »
Hi jimmejames,

From the menu bar I did a Quick reload and when finished went into KDE and checked the device tree in webadmin (already set up).

Both share volumes were still checked Online.

Maybe probably is related to using a password and the device needs to reconnect.

Have you tried letting it sit for a few minutes to see if it reconnects automatically?

I was wondering if an UpdateMedia scan which runs every two minutes or so (thank you colinjones for all your help) might kick it.

Anyway, I'll mark this item solved.

Cheers all.

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Solution: How can I make NAS device stay Online?
« Reply #11 on: July 13, 2009, 05:31:50 am »
Some further info that may help in understanding all this.

Online and mounted are not the same thing. Online is a specific LMCE state, where by a device is marked as "online" in the database, which can then be used in SQL queries to filter which media to display. Whereas, mounted is the underlying Linux concept, where a storage device is mounted into the /mnt/ folder (and symlinked into the correct location under /home/....)

Mounting is handled automatically (by autofs I think) as and when there is access to a given folder - even if that is just a terminal session CD'ing into the folder... hence Andrew's advice.

Thus a share can be both Online and not mounted at the same time. The Online status indicates that the share is available if _needed_, however it won't actually be mounted until something tries to access it. The Online status is checked and set by the StorageRadar, and it is this that will affect whether media is displayed or not, the underlying mounting, done by autofs, is purely functional and should be transparent to LMCE itself. However, as Andrew pointed out, with more than one share, the autofs system has a bug which means that it doesn't mount properly. The terminal/cd approach should fix that. Once that is resolved you can concentrate on keeping the device marked as Online....

I'm not sure what triggers StorageRadar, or whether it is just a periodic thing, but that would be the place to start. You should read through the scripts that implement this and even run them from the command line to try to identify where it thinks your shares are offline rather than online. Not sure exactly which script is responsible for which function, but it should be one of:

/usr/pluto/bin/StorageDevices_Radar.sh
/usr/pluto/bin/StorageDevices_SambaRadar.sh
/usr/pluto/bin/StorageDevices_StatusRadar.sh


colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Solution: How can I make NAS device stay Online?
« Reply #12 on: July 13, 2009, 06:21:26 am »
OK, it does look like most of the testing is done in that last file I listed.

The lines:
Code: [Select]
ping -qnc 1 -W 1 "$Device_IP" &> /dev/null
                HostIsUp=$?
                if [[ "$HostIsUp" != "0" ]] ;then
                        SetKidsOnline "$Device_ID" "0"
                        Log "Device $Device_ID ($Device_IP) doesn't respond to our ping."
                        continue
                fi

Imply that the NAS needs to be pingable, to be considered online... so check that (some security might block ICMPs)

The lines:
Code: [Select]
                        smbclient -U $Device_Username%$Device_Password --list=//
$Device_IP --grepable 2>/dev/null | grep "^Disk" | cut -d'|' -f2 | grep -q "^${S
hare_Name}$"

Imply that the share needs to be either advertised or at least mountable. You should try these in a terminal and see what it returns. If your NAS IP is 192.168.80.200, and your username and password are both "media", then...

smbclient -U media%media --list=//192.168.80.200 --grepable

You might get something like:

Domain=[ILUVATAR] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
IPC|IPC$|Remote IPC
Disk|D$|Default share
Disk|print$|Printer Drivers
Disk|SharedDocs|
Disk|media|
Disk|ADMIN$|Remote Admin
Disk|C$|Default share
Disk|JLL|
Printer|Printer|HP LaserJet 1200 Series PCL
session request to 192.168.80.248 failed (Called name not present)
session request to 192 failed (Called name not present)
Domain=[ILUVATAR] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

The greps and cuts pick out only the Disk shares, and slice out only the second field, which is the sharename. The last grep -q is a logical query, which will return a true status if that share name exists in the list... which is then tested using the if/fi on the next line. You can see it is running 3 separate tests.

The first 2 check 2 different ways to see if the share is visible - if neither approach works, it marks the share Offline. If at least one of them works, it moves on and attempts to see if the share is mountable - if that fails, it marks the share Offline. Only if at least one of the first 2 tests is successful AND the 3rd test is successful, does it mark the share Online.

So you need to simulate these commands, to see which of the conditions is failing for you. I suspect either the ping isn't working, or the shares are not visible (as even if the shares are mountable, if they are not visible, then the share is marked Offline.

Let me know if you need a more detailed explanation of any of this.

pigdog

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1006
    • View Profile
Re: Solution: How can I make NAS device stay Online?
« Reply #13 on: July 14, 2009, 04:33:44 am »
Hi jimmejames,

Since you programmed passwords did you try colinjones suggestions?

If not, I will program up username/passwords on DNS shares and device tree views to try to determine failing condition.

Cheers.

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Solution: How can I make NAS device stay Online?
« Reply #14 on: July 14, 2009, 05:20:26 am »
Don't forget trying to ping the NAS first - preferably from your core, using the ping command above. eg...

ping -qnc 1 -W 1 192.168.80.xxx &> /dev/null    (this will not return anything, but set a result code, which you can then test by...)

echo "$?"

If the output is "0" then it can ping your NAS, if it is "1" then it can't.

Let me know if you need any help setting up the troubleshooting tests for the other stuff. Happy to help out.